{"modulePath":"github.com/newstack-cloud/bluelink/libs/deploy-engine-client","version":"v0.5.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Constants\n\n```go\nconst ErrorCodeDeployChangeset = \"DEPLOY_CHANGESET\"\n```\nErrorCodeDeployChangeset is the error code returned when attempting to destroy using a changeset that was created for a deploy operation.\n\n```go\nconst ErrorCodeDestroyChangeset = \"DESTROY_CHANGESET\"\n```\nErrorCodeDestroyChangeset is the error code returned when attempting to deploy using a changeset that was created for a destroy operation.\n\n## Types\n\n```go\ntype AuthInitError struct {\n\tMessage string\n}\n```\nAuthInitError is an error type that indicates an issue with initialising auth configuration when creating a new deploy engine client.\n\n```go\nfunc (e *AuthInitError) Error() string\n```\n\n```go\ntype AuthPrepError struct {\n\tMessage string\n}\n```\nAuthPrepError is an error type that indicates an issue with preparing authentication headers for a request.\n\n```go\nfunc (e *AuthPrepError) Error() string\n```\n\n```go\ntype ClientError struct {\n\tStatusCode int\n\tMessage    string\n\t// Code is an optional error code that provides more specific information\n\t// about the error type. This allows clients to handle specific errors\n\t// programmatically without relying on message string matching.\n\tCode string\n\t// An optional list of validation errors that will usually\n\t// be populated for 422 responses for input validation errors.\n\tValidationErrors []*ValidationError\n\t// An optional list of diagnostics that provide additional information\n\t// about validation errors related to failed attempts to load a blueprint\n\t// document.\n\t// This will usually be populated for 422 responses.\n\tValidationDiagnostics []*core.Diagnostic\n\t// DriftBlockedResponse is populated for 409 responses when an operation\n\t// is blocked due to drift detection. Contains the reconciliation result\n\t// and changeset ID for continuing after reconciliation.\n\tDriftBlockedResponse *types.DriftBlockedResponse\n}\n```\nClientError 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.\n\n```go\nfunc IsDeployChangesetError(err error) (*ClientError, bool)\n```\nIsDeployChangesetError checks if the error is a client error indicating that a deploy changeset was used with a destroy operation.\n\n```go\nfunc IsDestroyChangesetError(err error) (*ClientError, bool)\n```\nIsDestroyChangesetError checks if the error is a client error indicating that a destroy changeset was used with a deploy operation.\n\n```go\nfunc IsDriftBlockedError(err error) (*ClientError, bool)\n```\nIsDriftBlockedError 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.\n\n```go\nfunc IsNotFoundError(err error) (*ClientError, bool)\n```\nIsNotFoundError 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.\n\n```go\nfunc IsValidationError(err error) (*ClientError, bool)\n```\nIsValidationError 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.\n\n```go\nfunc (e *ClientError) Error() string\n```\n\n```go\ntype DeserialiseError struct {\n\tMessage string\n}\n```\nDeserialiseError is an error type that indicates an issue with deserialising a request or response.\n\n```go\nfunc (e *DeserialiseError) Error() string\n```\n\n```go\ntype RequestError struct {\n\tErr error\n}\n```\nRequestError 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.\n\n```go\nfunc (e *RequestError) Error() string\n```\n\n```go\ntype RequestPrepError struct {\n\tMessage string\n}\n```\nRequestPrepError is an error type that indicates an issue with preparing a request for the deploy engine client.\n\n```go\nfunc (e *RequestPrepError) Error() string\n```\n\n```go\ntype Response struct {\n\tMessage     string             `json:\"message\"`\n\tCode        string             `json:\"code,omitempty\"`\n\tErrors      []*ValidationError `json:\"errors,omitempty\"`\n\tDiagnostics []*core.Diagnostic `json:\"validationDiagnostics,omitempty\"`\n}\n```\nResponse is a struct that represents a JSON error response from the Deploy Engine API.\n\n```go\ntype SerialiseError struct {\n\tMessage string\n}\n```\nSerialiseError is an error type that indicates an issue with serialising a request or response.\n\n```go\nfunc (e *SerialiseError) Error() string\n```\n\n```go\ntype StreamError struct {\n\tEvent *types.StreamErrorMessageEvent\n}\n```\nStreamError is an error type that indicates an unexpected error during an operation that can be streamed.\n\n```go\nfunc (e *StreamError) Error() string\n```\n\n```go\ntype ValidationError struct {\n\tLocation string `json:\"location\"`\n\tMessage  string `json:\"message\"`\n\tType     string `json:\"type\"`\n}\n```\nValidationError is a struct that represents a validation error that can be returned in responses to clients.\n\n","path":"github.com/newstack-cloud/bluelink/libs/deploy-engine-client/errors","name":"errors","synopsis":"","isRedistributable":true}
