errorresponse

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const AlreadyExistsCode = 3002
View Source
const AlreadyExistsMessage = "Resource already exists"
View Source
const DBErrorCode = 4001
View Source
const ExpiredTokenCode = 1003
View Source
const ExpiredTokenMessage = "Expired token"
View Source
const ExternalServiceAuthenticationErrorCode = 5004
View Source
const ExternalServiceAuthenticationErrorMessage = "Authentication error with external service"
View Source
const ExternalServiceTimeoutCode = 5002
View Source
const ExternalServiceTimeoutMessage = "External service request timed out"
View Source
const ExternalServiceUnreachableCode = 5001
View Source
const ExternalServiceUnreachableMessage = "External service is unreachable"
View Source
const ExternalStorageErrorCode = 5005
View Source
const ExternalStorageErrorMessage = "External storage error"
View Source
const FeatureNotImplementedCode = 9002
View Source
const FeatureNotImplementedMessage = "Feature not implemented"
View Source
const ForbiddenCode = 1101
View Source
const ForbiddenMessage = "Forbidden access"
View Source
const InternalServerErrorCode = 4002
View Source
const InternalServerErrorMessage = "Internal server error"
View Source
const InvalidExternalServiceResponseCode = 5003
View Source
const InvalidExternalServiceResponseMessage = "Invalid response from external service"
View Source
const InvalidFormatCode = 2002
View Source
const InvalidFormatMessage = "Invalid format"
View Source
const InvalidRequestCode = 2008
View Source
const InvalidRequestMessage = "Invalid request"
View Source
const InvalidTokenCode = 1002
View Source
const InvalidTokenMessage = "Invalid token"
View Source
const LogicErrorCode = 9004
View Source
const LogicErrorMessage = "Unexpected situation encountered. Please contact support."
View Source
const MissingRequestCode = 2001
View Source
const MissingRequestMessage = "Missing required fields"
View Source
const MissmatchedPatternCode = 2007
View Source
const MissmatchedPatternMessage = "Input does not match the required pattern"
View Source
const NotAllowedValueCode = 2006
View Source
const NotAllowedValueMessage = "Not allowed value"
View Source
const NotFoundCode = 3001
View Source
const NotFoundMessage = "Resource not found"
View Source
const OutOfRangeCode = 2005
View Source
const OutOfRangeMessage = "Input is out of range"
View Source
const TooLongCode = 2004
View Source
const TooLongMessage = "Input is too long"
View Source
const TooShortCode = 2003
View Source
const TooShortMessage = "Input is too short"
View Source
const UnauthorizedCode = 1001
View Source
const UnauthorizedMessage = "Unauthorized access"
View Source
const UncategorizedErrorCode = 9001

キャッチはできているけど未分類なエラー

View Source
const UncategorizedErrorMessage = "An error occurred"
View Source
const UnhandledErrorCode = 9099
View Source
const UnhandledErrorMessage = "Unhandled error occurred. Please contact support."
View Source
const UnknownErrorCode = 9003

こっちは完全に未知。ハンドルすらできていない

View Source
const UnknownErrorMessage = "Unknown error occurred. Please contact support."

Variables

View Source
var AlreadyExistsError = ErrorResponse{
	Code:    AlreadyExistsCode,
	Message: AlreadyExistsMessage,
}
View Source
var ExpiredTokenError = ErrorResponse{
	Code:    ExpiredTokenCode,
	Message: ExpiredTokenMessage,
}
View Source
var ExternalServiceTimeoutError = ErrorResponse{
	Code:    ExternalServiceTimeoutCode,
	Message: ExternalServiceTimeoutMessage,
}
View Source
var ExternalServiceUnreachableError = ErrorResponse{
	Code:    ExternalServiceUnreachableCode,
	Message: ExternalServiceUnreachableMessage,
}
View Source
var ExternalStorageError = ErrorResponse{
	Code:    ExternalStorageErrorCode,
	Message: ExternalStorageErrorMessage,
}
View Source
var FeatureNotImplementedError = ErrorResponse{
	Code:    FeatureNotImplementedCode,
	Message: FeatureNotImplementedMessage,
}
View Source
var ForbiddenError = ErrorResponse{
	Code:    ForbiddenCode,
	Message: ForbiddenMessage,
}
View Source
var InternalServerError = ErrorResponse{
	Code:    InternalServerErrorCode,
	Message: InternalServerErrorMessage,
}
View Source
var InvalidExternalServiceResponseError = ErrorResponse{
	Code:    InvalidExternalServiceResponseCode,
	Message: InvalidExternalServiceResponseMessage,
}
View Source
var InvalidFormatError = ErrorResponse{
	Code:    InvalidFormatCode,
	Message: InvalidFormatMessage,
}
View Source
var InvalidRequestError = ErrorResponse{
	Code:    InvalidRequestCode,
	Message: InvalidRequestMessage,
}
View Source
var InvalidTokenError = ErrorResponse{
	Code:    InvalidTokenCode,
	Message: InvalidTokenMessage,
}
View Source
var LogicError = ErrorResponse{
	Code:    LogicErrorCode,
	Message: LogicErrorMessage,
}
View Source
var MissingRequestError = ErrorResponse{
	Code:    MissingRequestCode,
	Message: MissingRequestMessage,
}
View Source
var MissmatchedPatternError = ErrorResponse{
	Code:    MissmatchedPatternCode,
	Message: MissmatchedPatternMessage,
}
View Source
var NotAllowedValueError = ErrorResponse{
	Code:    NotAllowedValueCode,
	Message: NotAllowedValueMessage,
}
View Source
var NotFoundError = ErrorResponse{
	Code:    NotFoundCode,
	Message: NotFoundMessage,
}
View Source
var OutOfRangeError = ErrorResponse{
	Code:    OutOfRangeCode,
	Message: OutOfRangeMessage,
}
View Source
var TooLongError = ErrorResponse{
	Code:    TooLongCode,
	Message: TooLongMessage,
}
View Source
var TooShortError = ErrorResponse{
	Code:    TooShortCode,
	Message: TooShortMessage,
}
View Source
var UnauthorizedError = ErrorResponse{
	Code:    UnauthorizedCode,
	Message: UnauthorizedMessage,
}
View Source
var UncategorizedError = ErrorResponse{
	Code:    UncategorizedErrorCode,
	Message: UncategorizedErrorMessage,
}
View Source
var UnhandledError = ErrorResponse{
	Code:    UnhandledErrorCode,
	Message: UnhandledErrorMessage,
}
View Source
var UnknownError = ErrorResponse{
	Code:    UnknownErrorCode,
	Message: UnknownErrorMessage,
}

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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