Documentation ¶
Overview ¶
Package errors have the predefined errors that can be used to denote various types of errors
Index ¶
- Constants
- type DB
- type DataStoreNotInitialized
- type DateTime
- type EntityAlreadyExists
- type EntityNotFound
- type Error
- type FileNotFound
- type ForbiddenRequest
- type HealthCheckFailed
- type InvalidParam
- type MethodMissing
- type MissingParam
- type MissingTemplate
- type MultipleErrors
- type Raw
- type Response
- type RootCause
- type Timeout
Constants ¶
const AWSSessionNotCreated = Error("some issue while creation of AWS session, session not initialized")
AWSSessionNotCreated error constant for issues in creating AWS Session
const InvalidFileStorage = Error("Invalid File Storage.Please set a valid value of FILE_STORE:{LOCAL or AZURE or GCP or AWS}")
InvalidFileStorage is used to show invalid file store config is provided
const SQLNotInitialized = Error("SQL not initialized")
SQLNotInitialized is used when SQL database is not initialized
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
Err error
}
DB standard error to encapsulate errors encountered when executing database operations
type DataStoreNotInitialized ¶
DataStoreNotInitialized standard error for errors in initializing datastore
func (DataStoreNotInitialized) Error ¶
func (d DataStoreNotInitialized) Error() string
Error returns an error message regarding the initialization of data store
type EntityAlreadyExists ¶
type EntityAlreadyExists struct{}
EntityAlreadyExists is used when a given entity already exist in the system
func (EntityAlreadyExists) Error ¶
func (e EntityAlreadyExists) Error() string
Error returns a message indicating that the entity already exists
type EntityNotFound ¶
EntityNotFound is used when a given entity is not found in the system
func (EntityNotFound) Error ¶
func (e EntityNotFound) Error() string
Error returns an error message indicating that the entity was not found
type FileNotFound ¶
FileNotFound is used when a requested file is not found in the system
func (FileNotFound) Error ¶
func (f FileNotFound) Error() string
Error returns an error message indicating that the file was not found
type ForbiddenRequest ¶
type ForbiddenRequest struct {
URL string
}
ForbiddenRequest is used when an incoming request is refused authorization
func (ForbiddenRequest) Error ¶
func (f ForbiddenRequest) Error() string
Error returns an error message indicating that access to URL is forbidden
type HealthCheckFailed ¶
type HealthCheckFailed struct { Dependency string `json:"dependency"` Reason string `json:"reason"` Err error `json:"err"` }
HealthCheckFailed is used when the health check for a dependency is failing
func (HealthCheckFailed) Error ¶
func (h HealthCheckFailed) Error() string
Error returns a formatted message that includes information regarding failed health check
type InvalidParam ¶
type InvalidParam struct {
Param []string
}
InvalidParam is used when an invalid parameter is passed in the request
func (InvalidParam) Error ¶
func (e InvalidParam) Error() string
Error returns an error message regarding incorrect parameter values for a request
type MethodMissing ¶
MethodMissing is used when the requested method is not present for the called endpoint (used for method not allowed)
func (MethodMissing) Error ¶
func (m MethodMissing) Error() string
Error returns an error message indicating that the method for a given URL is not defined
type MissingParam ¶
type MissingParam struct {
Param []string `json:"param"`
}
MissingParam is used when a required parameter is not present in the request
func (MissingParam) Error ¶
func (e MissingParam) Error() string
Error returns an error message regarding required parameters for a request
type MissingTemplate ¶
func (MissingTemplate) Error ¶
func (e MissingTemplate) Error() string
Error returns an error message regarding the absence of filename or existence of template
type MultipleErrors ¶
type MultipleErrors struct { StatusCode int `json:"-" xml:"-"` Errors []error `json:"errors" xml:"errors"` }
MultipleErrors is used when more than one error needs to be returned for a single request
func (MultipleErrors) Error ¶
func (m MultipleErrors) Error() string
Error returns a formatted error message by concatenating multiple error messages
type Response ¶
type Response struct { StatusCode int `json:"-"` Code string `json:"code"` Reason string `json:"reason"` ResourceID string `json:"resourceId,omitempty"` Detail interface{} `json:"detail,omitempty"` Path string `json:"path,omitempty"` RootCauses []RootCause `json:"rootCauses,omitempty"` DateTime `json:"datetime"` }
Response is used when a detailed error response needs to be returned
Source Files ¶
- AWSSessionNotCreated.go
- DataStoreNotInitialized.go
- EntityAlreadyExists.go
- EntityNotFound.go
- FileNotFound.go
- ForbiddenRequest.go
- HealthCheckFailed.go
- InvalidFileStorage.go
- InvalidParam.go
- MissingMethod.go
- MissingParam.go
- MissingTemplate.go
- MultipleErrors.go
- SQLNotInitialized.go
- Timeout.go
- db.go
- raw.go
- response.go