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 { await daytona.list()} catch (error) { if (error instanceof DaytonaAuthenticationError) { console.log(error.statusCode) }}Extends:
DaytonaError
Constructors
new DaytonaAuthenticationError()
new DaytonaAuthenticationError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaAuthenticationErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaAuthenticationError
Inherited from
DaytonaError.constructor
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
new DaytonaAuthorizationError()
new DaytonaAuthorizationError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaAuthorizationErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaAuthorizationError
Inherited from
DaytonaError.constructor
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
new DaytonaConflictError()
new DaytonaConflictError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaConflictErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaConflictError
Inherited from
DaytonaError.constructor
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
new DaytonaConnectionError()
new DaytonaConnectionError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaConnectionErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaConnectionError
Inherited from
DaytonaError.constructor
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
DaytonaNotFoundErrorDaytonaRateLimitErrorDaytonaAuthenticationErrorDaytonaAuthorizationErrorDaytonaConflictErrorDaytonaValidationErrorDaytonaTimeoutErrorDaytonaConnectionError
Constructors
new DaytonaError()
new DaytonaError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaError
Overrides
Error.constructorDaytonaNotFoundError
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
new DaytonaNotFoundError()
new DaytonaNotFoundError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaNotFoundErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaNotFoundError
Inherited from
DaytonaError.constructor
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 { await daytona.list()} catch (error) { if (error instanceof DaytonaRateLimitError) { console.log(error.errorCode) }}Extends:
DaytonaError
Constructors
new DaytonaRateLimitError()
new DaytonaRateLimitError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaRateLimitErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaRateLimitError
Inherited from
DaytonaError.constructor
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
new DaytonaTimeoutError()
new DaytonaTimeoutError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaTimeoutErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaTimeoutError
Inherited from
DaytonaError.constructor
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
new DaytonaValidationError()
new DaytonaValidationError( message: string, statusCode?: number, headers?: AxiosHeaders, errorCode?: string): DaytonaValidationErrorParameters:
messagestringstatusCode?numberheaders?AxiosHeaderserrorCode?string
Returns:
DaytonaValidationError
Inherited from
DaytonaError.constructor
createAxiosDaytonaError()
function createAxiosDaytonaError(error: AxiosError): DaytonaErrorCreates the appropriate Daytona error subclass from an Axios error.
Parameters:
errorAxiosError
Returns:
DaytonaError
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()
function errorClassFromStatusCode(statusCode?: number): typeof DaytonaErrorMaps an HTTP status code to the corresponding Daytona error class.
Parameters:
statusCode?number
Returns
typeof DaytonaError
ResponseHeaders
type ResponseHeaders = InstanceType<typeof AxiosHeaders>;