errors

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorCodeDeployChangeset = "DEPLOY_CHANGESET"

ErrorCodeDeployChangeset is the error code returned when attempting to destroy using a changeset that was created for a deploy operation.

View Source
const ErrorCodeDestroyChangeset = "DESTROY_CHANGESET"

ErrorCodeDestroyChangeset is the error code returned when attempting to deploy using a changeset that was created for a destroy operation.

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
	// Code is an optional error code that provides more specific information
	// about the error type. This allows clients to handle specific errors
	// programmatically without relying on message string matching.
	Code 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
	// DriftBlockedResponse is populated for 409 responses when an operation
	// is blocked due to drift detection. Contains the reconciliation result
	// and changeset ID for continuing after reconciliation.
	DriftBlockedResponse *types.DriftBlockedResponse
}

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 IsDeployChangesetError added in v0.2.0

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

IsDeployChangesetError checks if the error is a client error indicating that a deploy changeset was used with a destroy operation.

func IsDestroyChangesetError added in v0.2.0

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

IsDestroyChangesetError checks if the error is a client error indicating that a destroy changeset was used with a deploy operation.

func IsDriftBlockedError added in v0.2.0

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

IsDriftBlockedError checks if the error is a client error with a 409 status code, indicating that the operation is blocked due to drift detection. When true, the ClientError.DriftBlockedResponse field will contain the reconciliation result and changeset ID. This also returns the concrete client error that allows the caller access to more precise information about the error.

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"`
	Code        string             `json:"code,omitempty"`
	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