apierror

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ErrorCodeAborted = shared.ErrorCodeAborted
View Source
const ErrorCodeAlreadyExists = shared.ErrorCodeAlreadyExists
View Source
const ErrorCodeCanceled = shared.ErrorCodeCanceled
View Source
const ErrorCodeDataLoss = shared.ErrorCodeDataLoss
View Source
const ErrorCodeDeadlineExceeded = shared.ErrorCodeDeadlineExceeded
View Source
const ErrorCodeFailedPrecondition = shared.ErrorCodeFailedPrecondition
View Source
const ErrorCodeInternal = shared.ErrorCodeInternal
View Source
const ErrorCodeInvalidArgument = shared.ErrorCodeInvalidArgument
View Source
const ErrorCodeNotFound = shared.ErrorCodeNotFound
View Source
const ErrorCodeOutOfRange = shared.ErrorCodeOutOfRange
View Source
const ErrorCodePermissionDenied = shared.ErrorCodePermissionDenied
View Source
const ErrorCodeResourceExhausted = shared.ErrorCodeResourceExhausted
View Source
const ErrorCodeUnauthenticated = shared.ErrorCodeUnauthenticated
View Source
const ErrorCodeUnavailable = shared.ErrorCodeUnavailable
View Source
const ErrorCodeUnimplemented = shared.ErrorCodeUnimplemented
View Source
const ErrorCodeUnknown = shared.ErrorCodeUnknown

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// The status code, which should be an enum value of
	// [google.rpc.Code][google.rpc.Code].
	Code shared.ErrorCode `json:"code"`
	// A developer-facing error message, which should be in English. Any user-facing
	// error message should be localized and sent in the
	// [google.rpc.Status.details][google.rpc.Status.details] field, or localized by
	// the client.
	Message     string                 `json:"message"`
	ExtraFields map[string]interface{} `json:"-,extras"`
	JSON        errorJSON              `json:"-"`
	StatusCode  int
	Request     *http.Request
	Response    *http.Response
}

Error represents an error that originates from the API, i.e. when a request is made and the API returns a response with a HTTP status code. Other errors are not wrapped by this SDK.

func (*Error) DumpRequest

func (r *Error) DumpRequest(body bool) []byte

func (*Error) DumpResponse

func (r *Error) DumpResponse(body bool) []byte

func (*Error) Error

func (r *Error) Error() string

func (*Error) UnmarshalJSON

func (r *Error) UnmarshalJSON(data []byte) (err error)

type ErrorCode added in v0.3.2

type ErrorCode = shared.ErrorCode

Jump to

Keyboard shortcuts

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