Documentation
¶
Index ¶
- func HttpErrorHandle(err error, response *http.Response) error
- type ErrorCode
- type ErrorMessage
- type ErrorType
- type PermitError
- func NewPermitConflictError(response *http.Response) PermitError
- func NewPermitConnectionError(err error) PermitError
- func NewPermitContextError(additionalMessage ErrorMessage) PermitError
- func NewPermitDuplicateEntityError(err error, response *http.Response) PermitError
- func NewPermitError(errorMessage ErrorMessage, errorCode ErrorCode, errorType ErrorType, ...) PermitError
- func NewPermitForbiddenError(response *http.Response) PermitError
- func NewPermitNotFoundError(err error, response *http.Response) PermitError
- func NewPermitPaginationError() PermitError
- func NewPermitUnauthorizedError(response *http.Response) PermitError
- func NewPermitUnexpectedError(err error, response *http.Response) PermitError
- func NewPermitUnprocessableEntityError(err error, response *http.Response) PermitError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorCode ¶
type ErrorCode string
const ( UnexpectedError ErrorCode = "UnexpectedError" NotFound ErrorCode = "NotFound" Conflict ErrorCode = "Conflict" PaginationError ErrorCode = "PaginationError" TeapotError ErrorCode = "TeapotError" ContextError ErrorCode = "ContextError" DuplicateEntity ErrorCode = "DuplicateEntity" ConnectionError ErrorCode = "ConnectionError" UnprocessableEntityError ErrorCode = "UnprocessableEntityError" EmptyDecisionLogs ErrorCode = "EmptyDecisionLogs" MissingRequestAttribute ErrorCode = "MissingRequestAttribute" ForbiddenAccess ErrorCode = "ForbiddenAccess" InvalidPermissionFormat ErrorCode = "InvalidPermissionFormat" MissingPermissions ErrorCode = "MissingPermissions" UnsupportedAttributeType ErrorCode = "UnsupportedAttributeType" MissingResourceAttribute ErrorCode = "MissingResourceAttribute" InvalidPolicyRepoStatus ErrorCode = "InvalidPolicyRepoStatus" MismatchAttributesTypes ErrorCode = "MismatchAttributesTypes" )
type ErrorMessage ¶
type ErrorMessage string
const ( EmptyErrorMessage ErrorMessage = "" PaginationMessage ErrorMessage = "The pagination page and size per page are invalid" ConflictMessage ErrorMessage = "The resource already exists" NotFoundMessage ErrorMessage = "The resource was not found" UnexpectedErrorMessage ErrorMessage = "An unexpected error happened." ForbiddenMessage ErrorMessage = "The access for this object is forbidden using the provided API key" ContextMessage ErrorMessage = "The context is missing or invalid" ContextUnexpectedMessage ErrorMessage = "The context is missing or invalid" DuplicateEntityMessage ErrorMessage = "The entity already exists" ConnectionErrorMessage ErrorMessage = "The connection to the api failed" UnprocessableEntityMessage ErrorMessage = "The entity send with the request is not valid" )
type PermitError ¶
type PermitError struct {
StatusCode int
ResponseBody string
ErrorCode ErrorCode
ErrorType ErrorType
// contains filtered or unexported fields
}
func NewPermitConflictError ¶
func NewPermitConflictError(response *http.Response) PermitError
func NewPermitConnectionError ¶
func NewPermitConnectionError(err error) PermitError
func NewPermitContextError ¶
func NewPermitContextError(additionalMessage ErrorMessage) PermitError
func NewPermitDuplicateEntityError ¶
func NewPermitDuplicateEntityError(err error, response *http.Response) PermitError
func NewPermitError ¶
func NewPermitError(errorMessage ErrorMessage, errorCode ErrorCode, errorType ErrorType, response *http.Response) PermitError
func NewPermitForbiddenError ¶
func NewPermitForbiddenError(response *http.Response) PermitError
func NewPermitNotFoundError ¶
func NewPermitNotFoundError(err error, response *http.Response) PermitError
func NewPermitPaginationError ¶
func NewPermitPaginationError() PermitError
func NewPermitUnauthorizedError ¶
func NewPermitUnauthorizedError(response *http.Response) PermitError
func NewPermitUnexpectedError ¶
func NewPermitUnexpectedError(err error, response *http.Response) PermitError
func NewPermitUnprocessableEntityError ¶
func NewPermitUnprocessableEntityError(err error, response *http.Response) PermitError
Click to show internal directories.
Click to hide internal directories.