package
0.2.21
Repository: https://github.com/starius/api2.git
Documentation: pkg.go.dev

# README

errors wrappers

This package provides convenience wrappers for errors.

Each function in the package behaves like fmt.Errorf function, attaching corresponding HTTP status. The mapping of HTTP statuses:

FunctionHTTP code
Aborted409 Conflict
AlreadyExists409 Conflict
Canceled499 Client Closed Request
DataLoss500 Internal Server Error
DeadlineExceeded504 Gateway Timeout
FailedPrecondition400 Bad Request
Internal500 Internal Server Error
InvalidArgument400 Bad Request
NotFound404 Not Found
OutOfRange400 Bad Request
PermissionDenied403 Forbidden
ResourceExhausted429 Too Many Requests
Unauthenticated401 Unauthorized
Unavailable503 Service Unavailable
Unimplemented501 Not Implemented
Unknown500 Internal Server Error

The list can be found here.

# Functions

Aborted indicates the operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc.
AlreadyExists means an attempt to create an entity failed because one already exists.
Canceled indicates the operation was canceled (typically by the caller).
DataLoss indicates unrecoverable data loss or corruption.
DeadlineExceeded means operation expired before completion.
FailedPrecondition indicates operation was rejected because the system is not in a state required for the operation's execution.
Internal errors.
InvalidArgument indicates client specified an invalid argument.
NotFound means some requested entity (e.g., file or directory) was not found.
OutOfRange means operation was attempted past the valid range.
PermissionDenied indicates the caller does not have permission to execute the specified operation.
ResourceExhausted indicates some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.
Unauthenticated indicates the request does not have valid authentication credentials for the operation.
Unavailable indicates the service is currently unavailable.
Unimplemented indicates operation is not implemented or not supported/enabled in this service.
Unknown error.

# Structs

No description provided by the author