errorapi

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 2 Imported by: 0

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")
	ErrUnauthorized              = Define(ErrorCodeUnauthorized, ErrorCategoryUnauthorized, "unauthorized")
	ErrForbidden                 = Define(ErrorCodeForbidden, ErrorCategoryForbidden, "forbidden")
	ErrConflict                  = Define(ErrorCodeConflict, ErrorCategoryConflict, "conflict")
	ErrInvalidInput              = Define(ErrorCodeInvalidInput, ErrorCategoryInvalidInput, "invalid input")
	ErrRateLimited               = Define(ErrorCodeRateLimited, ErrorCategoryRateLimited, "rate limited")
	ErrUnavailable               = Define(ErrorCodeUnavailable, ErrorCategoryUnavailable, "unavailable")
	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")
	ErrObjectLocationUnavailable = Define(ErrorCodeObjectLocationUnavailable, ErrorCategoryNotFound, "no object location available")
	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")
	ErrStorageUnavailable        = Define(ErrorCodeStorageUnavailable, ErrorCategoryUnavailable, "storage unavailable")
	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")
	ErrStorageBucketUnavailable  = Define(ErrorCodeStorageBucketUnavailable, ErrorCategoryConflict, "storage bucket unavailable")
	ErrStorageListingIncomplete  = Define(ErrorCodeStorageListingIncomplete, ErrorCategoryUnavailable, "storage listing incomplete")
)

Functions

func IsBroadCode

func IsBroadCode(code ErrorCode) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

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"
	ErrorCategoryUnauthorized  ErrorCategory = "unauthorized"
	ErrorCategoryUnavailable   ErrorCategory = "unavailable"
)

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"
	ErrorCodeObjectLocationUnavailable ErrorCode = "object_location_unavailable"
	ErrorCodeObjectNotFound            ErrorCode = "object_not_found"
	ErrorCodeObjectSizeImmutable       ErrorCode = "object_size_immutable"
	ErrorCodeProjectScopeNotFound      ErrorCode = "project_scope_not_found"
	ErrorCodeRateLimited               ErrorCode = "rate_limited"
	ErrorCodeRequestFailed             ErrorCode = "request_failed"
	ErrorCodeStorageBucketUnavailable  ErrorCode = "storage_bucket_unavailable"
	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"
	ErrorCodeStorageUnavailable        ErrorCode = "storage_unavailable"
	ErrorCodeStorageUnsupported        ErrorCode = "storage_unsupported"
	ErrorCodeUnauthorized              ErrorCode = "unauthorized"
	ErrorCodeUnavailable               ErrorCode = "unavailable"
)

Defines values for ErrorCode.

func CodeForStatus

func CodeForStatus(status int) ErrorCode

func CodeOf

func CodeOf(err error) (ErrorCode, bool)

Jump to

Keyboard shortcuts

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