errors
Section titled “errors”import "github.com/daytonaio/daytona/libs/sdk-go/pkg/errors"- func ConvertAPIError(err error, httpResp *http.Response) error
- func ConvertToolboxError(err error, httpResp *http.Response) error
- func NewDaytonaErrorFromBody(body []byte, statusCode int, headers http.Header) error
- type DaytonaError
- type DaytonaNotFoundError
- type DaytonaRateLimitError
- type DaytonaTimeoutError
func ConvertAPIError
Section titled “func ConvertAPIError”func ConvertAPIError(err error, httpResp *http.Response) errorConvertAPIError converts api-client-go errors to SDK error types
func ConvertToolboxError
Section titled “func ConvertToolboxError”func ConvertToolboxError(err error, httpResp *http.Response) errorConvertToolboxError converts toolbox-api-client-go errors to SDK error types
func NewDaytonaErrorFromBody
Section titled “func NewDaytonaErrorFromBody”func NewDaytonaErrorFromBody(body []byte, statusCode int, headers http.Header) errorNewDaytonaErrorFromBody 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.
type DaytonaError
Section titled “type DaytonaError”DaytonaError is the base error type for all Daytona SDK errors
type DaytonaError struct { Message string StatusCode int Headers http.Header}func NewDaytonaError
Section titled “func NewDaytonaError”func NewDaytonaError(message string, statusCode int, headers http.Header) *DaytonaErrorNewDaytonaError creates a new DaytonaError
func (*DaytonaError) Error
Section titled “func (*DaytonaError) Error”func (e *DaytonaError) Error() stringtype DaytonaNotFoundError
Section titled “type DaytonaNotFoundError”DaytonaNotFoundError represents a resource not found error (404)
type DaytonaNotFoundError struct { *DaytonaError}func NewDaytonaNotFoundError
Section titled “func NewDaytonaNotFoundError”func NewDaytonaNotFoundError(message string, headers http.Header) *DaytonaNotFoundErrorNewDaytonaNotFoundError creates a new DaytonaNotFoundError
func (*DaytonaNotFoundError) Error
Section titled “func (*DaytonaNotFoundError) Error”func (e *DaytonaNotFoundError) Error() stringtype DaytonaRateLimitError
Section titled “type DaytonaRateLimitError”DaytonaRateLimitError represents a rate limit error (429)
type DaytonaRateLimitError struct { *DaytonaError}func NewDaytonaRateLimitError
Section titled “func NewDaytonaRateLimitError”func NewDaytonaRateLimitError(message string, headers http.Header) *DaytonaRateLimitErrorNewDaytonaRateLimitError creates a new DaytonaRateLimitError
func (*DaytonaRateLimitError) Error
Section titled “func (*DaytonaRateLimitError) Error”func (e *DaytonaRateLimitError) Error() stringtype DaytonaTimeoutError
Section titled “type DaytonaTimeoutError”DaytonaTimeoutError represents a timeout error
type DaytonaTimeoutError struct { *DaytonaError}func NewDaytonaTimeoutError
Section titled “func NewDaytonaTimeoutError”func NewDaytonaTimeoutError(message string) *DaytonaTimeoutErrorNewDaytonaTimeoutError creates a new DaytonaTimeoutError
func (*DaytonaTimeoutError) Error
Section titled “func (*DaytonaTimeoutError) Error”func (e *DaytonaTimeoutError) Error() string