コンテンツにスキップ
View as Markdown

このコンテンツはまだ日本語訳がありません。

import "github.com/daytonaio/daytona/libs/sdk-go/pkg/errors"
func ConvertAPIError(err error, httpResp *http.Response) error

ConvertAPIError converts api-client-go errors to SDK error types

func ConvertToolboxError(err error, httpResp *http.Response) error

ConvertToolboxError converts toolbox-api-client-go errors to SDK error types

func NewDaytonaErrorFromBody(body []byte, statusCode int, headers http.Header) error

NewDaytonaErrorFromBody parses a JSON response body and maps the status code to the appropriate SDK error type. Falls back to the raw body as the message.

DaytonaAuthenticationError represents an authentication error (401)

type DaytonaAuthenticationError struct {
*DaytonaError
}
func NewDaytonaAuthenticationError(message string, headers http.Header) *DaytonaAuthenticationError
func (e *DaytonaAuthenticationError) Error() string

DaytonaConflictError represents a conflict error (409)

type DaytonaConflictError struct {
*DaytonaError
}
func NewDaytonaConflictError(message string, headers http.Header) *DaytonaConflictError
func (e *DaytonaConflictError) Error() string

DaytonaError is the base error type for all Daytona SDK errors

type DaytonaError struct {
Message string
StatusCode int
Headers http.Header
}
func NewDaytonaError(message string, statusCode int, headers http.Header) *DaytonaError

NewDaytonaError creates a new DaytonaError

func (e *DaytonaError) Error() string

DaytonaForbiddenError represents a forbidden/authorization error (403)

type DaytonaForbiddenError struct {
*DaytonaError
}
func NewDaytonaForbiddenError(message string, headers http.Header) *DaytonaForbiddenError
func (e *DaytonaForbiddenError) Error() string

DaytonaNotFoundError represents a resource not found error (404)

type DaytonaNotFoundError struct {
*DaytonaError
}
func NewDaytonaNotFoundError(message string, headers http.Header) *DaytonaNotFoundError

NewDaytonaNotFoundError creates a new DaytonaNotFoundError

func (e *DaytonaNotFoundError) Error() string

DaytonaRateLimitError represents a rate limit error (429)

type DaytonaRateLimitError struct {
*DaytonaError
}
func NewDaytonaRateLimitError(message string, headers http.Header) *DaytonaRateLimitError

NewDaytonaRateLimitError creates a new DaytonaRateLimitError

func (e *DaytonaRateLimitError) Error() string

DaytonaServerError represents a server error (5xx)

type DaytonaServerError struct {
*DaytonaError
}
func NewDaytonaServerError(message string, statusCode int, headers http.Header) *DaytonaServerError
func (e *DaytonaServerError) Error() string

DaytonaTimeoutError represents a timeout error

type DaytonaTimeoutError struct {
*DaytonaError
}
func NewDaytonaTimeoutError(message string) *DaytonaTimeoutError
func (e *DaytonaTimeoutError) Error() string

DaytonaValidationError represents a validation/bad request error (400)

type DaytonaValidationError struct {
*DaytonaError
}
func NewDaytonaValidationError(message string, headers http.Header) *DaytonaValidationError
func (e *DaytonaValidationError) Error() string