errors

package
v0.0.0-...-4f221f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthInitError

type AuthInitError struct {
	Message string
}

AuthInitError is an error type that indicates an issue with initialising auth configuration when creating a new deploy engine client.

func (*AuthInitError) Error

func (e *AuthInitError) Error() string

type AuthPrepError

type AuthPrepError struct {
	Message string
}

AuthPrepError is an error type that indicates an issue with preparing authentication headers for a request.

func (*AuthPrepError) Error

func (e *AuthPrepError) Error() string

type ClientError

type ClientError struct {
	StatusCode int
	Message    string
	// An optional list of validation errors that will usually
	// be populated for 422 responses for input validation errors.
	ValidationErrors []*ValidationError
	// An optional list of diagnostics that provide additional information
	// about validation errors related to failed attempts to load a blueprint
	// document.
	// This will usually be populated for 422 responses.
	ValidationDiagnostics []*core.Diagnostic
}

ClientError is an error type that indicates an unexpected response from the deploy engine client. This will usually wrap a non-2xx status code and an error message from the server.

func IsNotFoundError

func IsNotFoundError(err error) (*ClientError, bool)

IsNotFoundError checks if the error is a client error with a 404 status code, indicating that the requested resource was not found. This also returns the concrete client error that allows the caller access to more precise information about the error.

func IsValidationError

func IsValidationError(err error) (*ClientError, bool)

IsValidationError checks if the error is a client error with a 422 or 400 status code, indicating that one or more elements of the request failed validation. This also returns the concrete client error that allows the caller access to more precise information about the error.

func (*ClientError) Error

func (e *ClientError) Error() string

type DeserialiseError

type DeserialiseError struct {
	Message string
}

DeserialiseError is an error type that indicates an issue with deserialising a request or response.

func (*DeserialiseError) Error

func (e *DeserialiseError) Error() string

type RequestError

type RequestError struct {
	Err error
}

RequestError is an error type that indicates an issue with making a request to the deploy engine client. This will usually wrap a network or timeout error.

func (*RequestError) Error

func (e *RequestError) Error() string

type RequestPrepError

type RequestPrepError struct {
	Message string
}

RequestPrepError is an error type that indicates an issue with preparing a request for the deploy engine client.

func (*RequestPrepError) Error

func (e *RequestPrepError) Error() string

type Response

type Response struct {
	Message     string             `json:"message"`
	Errors      []*ValidationError `json:"errors,omitempty"`
	Diagnostics []*core.Diagnostic `json:"validationDiagnostics,omitempty"`
}

Response is a struct that represents a JSON error response from the Deploy Engine API.

type SerialiseError

type SerialiseError struct {
	Message string
}

SerialiseError is an error type that indicates an issue with serialising a request or response.

func (*SerialiseError) Error

func (e *SerialiseError) Error() string

type StreamError

type StreamError struct {
	Event *types.StreamErrorMessageEvent
}

StreamError is an error type that indicates an unexpected error during an operation that can be streamed.

func (*StreamError) Error

func (e *StreamError) Error() string

type ValidationError

type ValidationError struct {
	Location string `json:"location"`
	Message  string `json:"message"`
	Type     string `json:"type"`
}

ValidationError is a struct that represents a validation error that can be returned in responses to clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL