Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,22 @@
"icon": "python",
"versions": [
{
"version": "v2.15.2",
"version": "v2.15.3",
"default": true,
"pages": [
"docs/sdk-reference/python-sdk/v2.15.3/exceptions",
"docs/sdk-reference/python-sdk/v2.15.3/logger",
"docs/sdk-reference/python-sdk/v2.15.3/readycmd",
"docs/sdk-reference/python-sdk/v2.15.3/sandbox_async",
"docs/sdk-reference/python-sdk/v2.15.3/sandbox_sync",
"docs/sdk-reference/python-sdk/v2.15.3/template",
"docs/sdk-reference/python-sdk/v2.15.3/template_async",
"docs/sdk-reference/python-sdk/v2.15.3/template_sync"
]
},
{
"version": "v2.15.2",
"default": false,
"pages": [
"docs/sdk-reference/python-sdk/v2.15.2/exceptions",
"docs/sdk-reference/python-sdk/v2.15.2/logger",
Expand Down
136 changes: 136 additions & 0 deletions docs/sdk-reference/python-sdk/v2.15.3/exceptions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
sidebarTitle: "Exceptions"
---






## SandboxException

```python
class SandboxException(Exception)
```

Base class for all sandbox errors.

Raised when a general sandbox exception occurs.



## TimeoutException

```python
class TimeoutException(SandboxException)
```

Raised when a timeout occurs.

The `unavailable` exception type is caused by sandbox timeout.

The `canceled` exception type is caused by exceeding request timeout.

The `deadline_exceeded` exception type is caused by exceeding the timeout for process, watch, etc.

The `unknown` exception type is sometimes caused by the sandbox timeout when the request is not processed correctly.



## InvalidArgumentException

```python
class InvalidArgumentException(SandboxException)
```

Raised when an invalid argument is provided.



## NotEnoughSpaceException

```python
class NotEnoughSpaceException(SandboxException)
```

Raised when there is not enough disk space.



## NotFoundException

```python
class NotFoundException(SandboxException)
```

Raised when a resource is not found.



## AuthenticationException

```python
class AuthenticationException(Exception)
```

Raised when authentication fails.



## GitAuthException

```python
class GitAuthException(AuthenticationException)
```

Raised when git authentication fails.



## GitUpstreamException

```python
class GitUpstreamException(SandboxException)
```

Raised when git upstream tracking is missing.



## TemplateException

```python
class TemplateException(SandboxException)
```

Exception raised when the template uses old envd version. It isn't compatible with the new SDK.

Check warning on line 106 in docs/sdk-reference/python-sdk/v2.15.3/exceptions.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/sdk-reference/python-sdk/v2.15.3/exceptions.mdx#L106

Did you really mean 'envd'?



## RateLimitException

```python
class RateLimitException(SandboxException)
```

Raised when the API rate limit is exceeded.



## BuildException

```python
class BuildException(Exception)
```

Raised when the build fails.



## FileUploadException

```python
class FileUploadException(BuildException)
```

Raised when the file upload fails.
105 changes: 105 additions & 0 deletions docs/sdk-reference/python-sdk/v2.15.3/logger.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
sidebarTitle: "Logger"
---






## LogEntry

```python
@dataclass
class LogEntry()
```

Represents a single log entry from the template build process.



## LogEntryStart

```python
@dataclass
class LogEntryStart(LogEntry)
```

Special log entry indicating the start of a build process.



## LogEntryEnd

```python
@dataclass
class LogEntryEnd(LogEntry)
```

Special log entry indicating the end of a build process.



### TIMER\_UPDATE\_INTERVAL\_MS

Default minimum log level to display.



### DEFAULT\_LEVEL

Colored labels for each log level.



### levels

Numeric ordering of log levels for comparison (lower = less severe).



### set\_interval

```python
def set_interval(func, interval)

Check warning on line 64 in docs/sdk-reference/python-sdk/v2.15.3/logger.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/sdk-reference/python-sdk/v2.15.3/logger.mdx#L64

Did you really mean 'set_interval'?
```

Returns a stop function that can be called to cancel the interval.

Similar to JavaScript's setInterval.

Check warning on line 69 in docs/sdk-reference/python-sdk/v2.15.3/logger.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/sdk-reference/python-sdk/v2.15.3/logger.mdx#L69

Did you really mean 'setInterval'?

**Arguments**:

- `func`: Function to execute at each interval
- `interval`: Interval duration in **seconds**

**Returns**:

Stop function that can be called to cancel the interval



### default\_build\_logger

```python
def default_build_logger(

Check warning on line 85 in docs/sdk-reference/python-sdk/v2.15.3/logger.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/sdk-reference/python-sdk/v2.15.3/logger.mdx#L85

Did you really mean 'default_build_logger'?
min_level: Optional[LogEntryLevel] = None
) -> Callable[[LogEntry], None]
```

Create a default build logger with animated timer display.

**Arguments**:

- `min_level`: Minimum log level to display (default: 'info')

**Returns**:

Logger function that accepts LogEntry instances
Example
```python
from e2b import Template, default_build_logger

template = Template().from_python_image()

```
Loading
Loading