DaytonaAuthenticationError
Section titled “DaytonaAuthenticationError”Error thrown when authentication fails (HTTP 401).
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { for await (const sandbox of daytona.list()) { console.log(sandbox.id) }} catch (error) { if (error instanceof DaytonaAuthenticationError) { console.log(error.statusCode) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaAuthenticationError()
Section titled “new DaytonaAuthenticationError()”new DaytonaAuthenticationError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaAuthenticationErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaAuthenticationError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
DaytonaAuthorizationError
Section titled “DaytonaAuthorizationError”Error thrown when the request is forbidden (HTTP 403).
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { await daytona.get('sandbox-without-access')} catch (error) { if (error instanceof DaytonaAuthorizationError) { console.log(error.message) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaAuthorizationError()
Section titled “new DaytonaAuthorizationError()”new DaytonaAuthorizationError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaAuthorizationErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaAuthorizationError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
DaytonaConflictError
Section titled “DaytonaConflictError”Error thrown when a resource conflict occurs (HTTP 409).
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { await daytona.create({ name: 'existing-sandbox' })} catch (error) { if (error instanceof DaytonaConflictError) { console.log(error.errorCode) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaConflictError()
Section titled “new DaytonaConflictError()”new DaytonaConflictError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaConflictErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaConflictError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
DaytonaConnectionError
Section titled “DaytonaConnectionError”Error thrown when a network connection fails.
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { await ptyHandle.waitForConnection()} catch (error) { if (error instanceof DaytonaConnectionError) { console.log(error.message) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaConnectionError()
Section titled “new DaytonaConnectionError()”new DaytonaConnectionError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaConnectionErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaConnectionError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
DaytonaError
Section titled “DaytonaError”Base error for Daytona SDK.
Properties:
errorCode?string - Machine-readable error code if availableheaders?AxiosHeaders - Response headers if availablestatusCode?number - HTTP status code if available
Example:
try { await daytona.get('missing-sandbox')} catch (error) { if (error instanceof DaytonaError) { console.log(error.statusCode) console.log(error.errorCode) console.log(error.message) }}Extends:
Error
Extended by
Section titled “Extended by”DaytonaNotFoundErrorDaytonaRateLimitErrorDaytonaAuthenticationErrorDaytonaAuthorizationErrorDaytonaConflictErrorDaytonaValidationErrorDaytonaTimeoutErrorDaytonaConnectionError
Constructors
Section titled “Constructors”new DaytonaError()
Section titled “new DaytonaError()”new DaytonaError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaError
Overrides
Section titled “Overrides”Error.constructorDaytonaNotFoundError
Section titled “DaytonaNotFoundError”Error thrown when a resource is not found (HTTP 404).
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { await sandbox.fs.downloadFile('/workspace/missing.txt')} catch (error) { if (error instanceof DaytonaNotFoundError) { console.log(error.statusCode) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaNotFoundError()
Section titled “new DaytonaNotFoundError()”new DaytonaNotFoundError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaNotFoundErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaNotFoundError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
DaytonaRateLimitError
Section titled “DaytonaRateLimitError”Error thrown when rate limit is exceeded.
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { for await (const sandbox of daytona.list()) { console.log(sandbox.id) }} catch (error) { if (error instanceof DaytonaRateLimitError) { console.log(error.errorCode) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaRateLimitError()
Section titled “new DaytonaRateLimitError()”new DaytonaRateLimitError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaRateLimitErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaRateLimitError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
DaytonaTimeoutError
Section titled “DaytonaTimeoutError”Error thrown when a timeout occurs.
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { await sandbox.waitUntilStarted(1)} catch (error) { if (error instanceof DaytonaTimeoutError) { console.log(error.message) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaTimeoutError()
Section titled “new DaytonaTimeoutError()”new DaytonaTimeoutError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaTimeoutErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaTimeoutError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
DaytonaValidationError
Section titled “DaytonaValidationError”Error thrown when input validation fails (HTTP 400 or client-side validation).
Properties:
-
errorCode?string - Machine-readable error code if available- Inherited from:
DaytonaError.errorCode
- Inherited from:
-
headers?AxiosHeaders - Response headers if available- Inherited from:
DaytonaError.headers
- Inherited from:
-
statusCode?number - HTTP status code if available- Inherited from:
DaytonaError.statusCode
- Inherited from:
Example:
try { Image.debianSlim('3.8' as never)} catch (error) { if (error instanceof DaytonaValidationError) { console.log(error.message) }}Extends:
DaytonaError
Constructors
Section titled “Constructors”new DaytonaValidationError()
Section titled “new DaytonaValidationError()”new DaytonaValidationError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaValidationErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaValidationError
Inherited from
Section titled “Inherited from”DaytonaError.constructor
createAxiosDaytonaError()
Section titled “createAxiosDaytonaError()”function createAxiosDaytonaError(error: AxiosError): DaytonaErrorCreates the appropriate Daytona error subclass from an Axios error.
Parameters:
errorAxiosError
Returns:
DaytonaError
createDaytonaError()
Section titled “createDaytonaError()”function createDaytonaError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaErrorCreates the appropriate Daytona error subclass from structured error metadata.
Parameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaError
errorClassFromStatusCode()
Section titled “errorClassFromStatusCode()”function errorClassFromStatusCode(statusCode?: number): typeof DaytonaErrorMaps an HTTP status code to the corresponding Daytona error class.
Parameters:
statusCode?number
Returns
Section titled “Returns”typeof DaytonaError
ResponseHeaders
Section titled “ResponseHeaders”type ResponseHeaders = InstanceType<typeof AxiosHeaders>;