Documentation
¶
Overview ¶
Package errorapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = Define(ErrorCodeNotFound, ErrorCategoryNotFound, "not found") ErrForbidden = Define(ErrorCodeForbidden, ErrorCategoryForbidden, "forbidden") ErrConflict = Define(ErrorCodeConflict, ErrorCategoryConflict, "conflict") ErrInvalidInput = Define(ErrorCodeInvalidInput, ErrorCategoryInvalidInput, "invalid input") ErrRateLimited = Define(ErrorCodeRateLimited, ErrorCategoryRateLimited, "rate limited") ErrObjectNotFound = Define(ErrorCodeObjectNotFound, ErrorCategoryNotFound, "object not found") ErrBucketScopeNotFound = Define(ErrorCodeBucketScopeNotFound, ErrorCategoryNotFound, "bucket scope not found") ErrFileUsageNotFound = Define(ErrorCodeFileUsageNotFound, ErrorCategoryNotFound, "file usage not found") ErrMultipartUploadNotFound = Define(ErrorCodeMultipartUploadNotFound, ErrorCategoryNotFound, "multipart upload not found") ErrNoValidSHA256 = Define(ErrorCodeNoValidSha256, ErrorCategoryInvalidInput, "no valid sha256 values provided") ErrConflictingSHA256 = Define(ErrorCodeConflictingSha256, ErrorCategoryConflict, "conflicting sha256 values provided") ErrAccessMethodsRequired = Define(ErrorCodeAccessMethodsRequired, ErrorCategoryInvalidInput, "candidate must include at least one access method with a non-empty url") ErrObjectSizeImmutable = Define(ErrorCodeObjectSizeImmutable, ErrorCategoryConflict, "object size is immutable") ErrObjectChecksumImmutable = Define(ErrorCodeObjectChecksumImmutable, ErrorCategoryConflict, "object checksum identity is immutable") ErrBulkOverwriteConflict = Define(ErrorCodeBulkOverwriteConflict, ErrorCategoryConflict, "bulk overwrite conflict") ErrBucketNotConfigured = Define(ErrorCodeBucketNotConfigured, ErrorCategoryUnavailable, "no bucket configured") ErrAuthenticationRequired = Define(ErrorCodeAuthenticationRequired, ErrorCategoryUnauthorized, "authentication required") ErrAccessDenied = Define(ErrorCodeAccessDenied, ErrorCategoryForbidden, "access denied") ErrStorageInvalid = Define(ErrorCodeStorageInvalid, ErrorCategoryInvalidInput, "storage invalid") ErrStorageNotFound = Define(ErrorCodeStorageNotFound, ErrorCategoryNotFound, "storage not found") ErrStorageForbidden = Define(ErrorCodeStorageForbidden, ErrorCategoryForbidden, "storage forbidden") ErrStorageIncomplete = Define(ErrorCodeStorageIncomplete, ErrorCategoryUnavailable, "storage incomplete") ErrStorageUnsupported = Define(ErrorCodeStorageUnsupported, ErrorCategoryInvalidInput, "storage unsupported") ErrStorageProviderError = Define(ErrorCodeStorageProviderError, ErrorCategoryUnavailable, "storage provider error") ErrProjectScopeNotFound = Define(ErrorCodeProjectScopeNotFound, ErrorCategoryNotFound, "project scope not found") ErrStorageCredentialMissing = Define(ErrorCodeStorageCredentialMissing, ErrorCategoryNotFound, "storage credential missing") ErrStorageListingIncomplete = Define(ErrorCodeStorageListingIncomplete, ErrorCategoryUnavailable, "storage listing incomplete") )
Functions ¶
func IsBroadCode ¶
func IsNotFoundError ¶
Types ¶
type APIError ¶
type APIError struct {
// Category Broad machine-readable error category.
Category ErrorCategory `json:"category"`
// Code Stable machine-readable application error code.
Code ErrorCode `json:"code"`
// Message Human-readable error message.
Message string `json:"message"`
// Msg GA4GH-compatible alias for message.
// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Msg *string `json:"msg,omitempty"`
// RequestId Request identifier for support and log correlation.
RequestId *string `json:"request_id,omitempty"`
// Status HTTP response status.
Status int `json:"status"`
// StatusCode GA4GH-compatible alias for status.
// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
StatusCode *int `json:"status_code,omitempty"`
}
APIError A stable Syfon API error.
type Definition ¶
type Definition struct {
// contains filtered or unexported fields
}
func Define ¶
func Define(code ErrorCode, category ErrorCategory, message string) *Definition
func (*Definition) Error ¶
func (e *Definition) Error() string
func (*Definition) ErrorCategory ¶
func (e *Definition) ErrorCategory() ErrorCategory
func (*Definition) ErrorCode ¶
func (e *Definition) ErrorCode() ErrorCode
func (*Definition) Is ¶
func (e *Definition) Is(target error) bool
type ErrorCategory ¶
type ErrorCategory string
ErrorCategory Broad machine-readable error category.
const ( ErrorCategoryConflict ErrorCategory = "conflict" ErrorCategoryForbidden ErrorCategory = "forbidden" ErrorCategoryInternalError ErrorCategory = "internal_error" ErrorCategoryInvalidInput ErrorCategory = "invalid_input" ErrorCategoryNotFound ErrorCategory = "not_found" ErrorCategoryRateLimited ErrorCategory = "rate_limited" )
Defines values for ErrorCategory.
func CategoryForCode ¶
func CategoryForCode(code ErrorCode) (ErrorCategory, bool)
func CategoryForStatus ¶
func CategoryForStatus(status int) ErrorCategory
func CategoryOf ¶
func CategoryOf(err error) (ErrorCategory, bool)
type ErrorCode ¶
type ErrorCode string
ErrorCode Stable machine-readable application error code.
const ( ErrorCodeAccessDenied ErrorCode = "access_denied" ErrorCodeAccessMethodsRequired ErrorCode = "access_methods_required" ErrorCodeAuthenticationRequired ErrorCode = "authentication_required" ErrorCodeBucketNotConfigured ErrorCode = "bucket_not_configured" ErrorCodeBucketScopeNotFound ErrorCode = "bucket_scope_not_found" ErrorCodeBulkOverwriteConflict ErrorCode = "bulk_overwrite_conflict" ErrorCodeConflict ErrorCode = "conflict" ErrorCodeConflictingSha256 ErrorCode = "conflicting_sha256" ErrorCodeFileUsageNotFound ErrorCode = "file_usage_not_found" ErrorCodeForbidden ErrorCode = "forbidden" ErrorCodeInternalError ErrorCode = "internal_error" ErrorCodeInvalidInput ErrorCode = "invalid_input" ErrorCodeMultipartUploadNotFound ErrorCode = "multipart_upload_not_found" ErrorCodeNoValidSha256 ErrorCode = "no_valid_sha256" ErrorCodeNotFound ErrorCode = "not_found" ErrorCodeObjectChecksumImmutable ErrorCode = "object_checksum_immutable" ErrorCodeObjectNotFound ErrorCode = "object_not_found" ErrorCodeObjectSizeImmutable ErrorCode = "object_size_immutable" ErrorCodeProjectScopeNotFound ErrorCode = "project_scope_not_found" ErrorCodeRateLimited ErrorCode = "rate_limited" ErrorCodeRequestFailed ErrorCode = "request_failed" ErrorCodeStorageCredentialMissing ErrorCode = "storage_credential_missing" ErrorCodeStorageForbidden ErrorCode = "storage_forbidden" ErrorCodeStorageIncomplete ErrorCode = "storage_incomplete" ErrorCodeStorageInvalid ErrorCode = "storage_invalid" ErrorCodeStorageListingIncomplete ErrorCode = "storage_listing_incomplete" ErrorCodeStorageNotFound ErrorCode = "storage_not_found" ErrorCodeStorageProviderError ErrorCode = "storage_provider_error" ErrorCodeStorageUnsupported ErrorCode = "storage_unsupported" )
Defines values for ErrorCode.
func CodeForStatus ¶
Click to show internal directories.
Click to hide internal directories.