{"modulePath":"github.com/Kviky/errors","version":"v1.0.21","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Constants\n\n```go\nconst (\n\tInstApp      = \"app\"\n\tInstExport   = \"export\"\n\tInstImage    = \"image\"\n\tInstApi      = \"api\"\n\tInstIdentity = \"identity\"\n\tInstClient   = \"client\"\n\tInstDB       = \"database\"\n)\n```\nTypes of instances\n\n```go\nconst (\n\tAlreadyExists           = \"Already exists!\"\n\tOffersEnded             = \"Offers ended today!\"\n\tOffersMaxListings       = \"Maximum listings reached!\"\n\tImageInvalid            = \"File is not a valid image!\"\n\tImageNotDeleted         = \"Image cannot be deleted!\"\n\tImageNotUploaded        = \"Image cannot be uploaded!\"\n\tBadRequest              = \"Bad request!\"\n\tCharterHasListings      = \"Charter cannot be deleted!\"\n\tCharterNotCreated       = \"Charter not created!\"\n\tFileExistsAlready       = \"File exists already!\"\n\tFileNotCreated          = \"File not created!\"\n\tInactiveListing         = \"Inactive Listing!\"\n\tInvalidMsgFormat        = \"Invalid message format!\"\n\tInvalidBodyParam        = \"Invalid body parameter!\"\n\tInvalidDates            = \"Invalid dates!\"\n\tInvalidHeaderParam      = \"Invalid header parameter!\"\n\tInvalidOwnerListing     = \"Invalid owner listing!\"\n\tInvalidQueryParam       = \"Invalid query parameter!\"\n\tInvalidPathParam        = \"Invalid path parameter!\"\n\tListingNotCreated       = \"Listing not created!\"\n\tLocationNotCreated      = \"Location not created!\"\n\tMandatoryParamIncorrect = \"Mandatory parameter incorrect!\"\n\tMandatoryParamMissing   = \"Mandatory parameter missing!\"\n\tNameAlreadyTaken        = \"Name is already taken!\"\n\tPortAlreadyExists       = \"Port name exists already!\"\n\tReservationNotCreated   = \"Reservation not created!\"\n)\n```\nList of 400 errors\n\n```go\nconst (\n\tInvalidAuthToken   = \"Invalid authorization token!\"\n\tMissingAuthToken   = \"Missing authorization token!\"\n\tUnauthorizedAccess = \"Unauthorized access!\"\n)\n```\nList of 401 errors\n\n```go\nconst (\n\tForbiddenAction   = \"Forbidden action!\"\n\tForbiddenResource = \"Forbidden resource!\"\n\tForbiddenUpload   = \"Forbidden upload!\"\n)\n```\nList of 403 errors\n\n```go\nconst (\n\tCharterNotFound     = \"Charter not found!\"\n\tListingNotFound     = \"Listing not found!\"\n\tLocationNotFound    = \"Location not found!\"\n\tReservationNotFound = \"Reservation not found!\"\n\tResourceNotFound    = \"Resource not found!\"\n\tUserNotFound        = \"User not found!\"\n\tUsersNotFound       = \"Users not found!\"\n)\n```\nlist of 404 errors\n\n```go\nconst (\n\tSystemFailure      = \"System failure!\"\n\tUnspecifiedFailure = \"Unspecified failure!\"\n)\n```\nList of 500 errors\n\n```go\nconst (\n\tCongestionRisk = \"Too many requests!\"\n)\n```\nlist of 429 errors\n\n```go\nconst (\n\tGatewayTimeout = \"Gateway Timeout!\"\n)\n```\nList of 504 errors\n\n```go\nconst (\n\tMethodNotAllowed = \"Method not allowed!\"\n)\n```\nlist of 405 errors\n\n```go\nconst (\n\tServiceUnavailable = \"Service Unavailable!\"\n)\n```\nList of 503 errors\n\n## Functions\n\n```go\nfunc CreateProblemDetails(errorName string) *models.ProblemDetails\n```\nCreateProblemDetails - Helper function to create ProblemDetails object\n\n```go\nfunc NewImageSizeError(size int64) *models.InvalidParam\n```\n\n```go\nfunc NewImageSizePxError(name string, px int) *models.InvalidParam\n```\n\n```go\nfunc NewInvalidParam(name string) *models.InvalidParam\n```\n\n```go\nfunc NewMissingParam(name string) *models.InvalidParam\n```\n\n```go\nfunc ServeError(rw http.ResponseWriter, r *http.Request, err error)\n```\nServeError the error handler interface implementation\n\n","path":"github.com/Kviky/errors","name":"errors","synopsis":"","isRedistributable":true}
