Documentation ¶
Index ¶
- Variables
- func IsFatalError(err error) bool
- func NewAuthenticationErr(code int, format string, args ...interface{}) error
- func NewHTTPErr(scode, code int, format string, args ...interface{}) error
- type FatalErr
- type HTTPErr
- func (he *HTTPErr) Error() string
- func (he *HTTPErr) GetLocalCode() int
- func (he *HTTPErr) GetLocalMsg() string
- func (he *HTTPErr) GetRemoteCode() int
- func (he *HTTPErr) GetRemoteMsg() string
- func (he *HTTPErr) GetStatusCode() int
- func (he *HTTPErr) Remote(code int, format string, args ...interface{}) *HTTPErr
- func (he *HTTPErr) String() string
- type ServerErr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Unknown error code ErrUnknown = 0 // HTTP method not allowed ErrMethodNotAllowed = 1 // No authorization header was found in request ErrNoAuthHdr = 2 // Failed reading the HTTP request body ErrReadingReqBody = 3 // HTTP request body was empty but should not have been ErrEmptyReqBody = 4 // HTTP request body was of the wrong format ErrBadReqBody = 5 // Authorization failure ErrAuthenticationFailure = 20 // No username and password were in the authorization header ErrNoUserPass = 21 // Enrollment is currently disabled for the server ErrEnrollDisabled = 22 // Invalid user name ErrInvalidUser = 23 // Invalid password ErrInvalidPass = 24 // Bad certificate signing request ErrBadCSR = 31 // Error connecting to database ErrConnectingDB = 51 // Error occured when making a Get request to database ErrDBGet = 63 // Error occured while deleting user ErrDBDeleteUser = 65 // Incorrect password limit reached ErrPasswordAttempts = 73 )
Error codes
Functions ¶
func IsFatalError ¶
IsFatalError return true if the error is of type 'FatalErr'
func NewAuthenticationErr ¶
NewAuthenticationErr constructs an HTTP error specifically indicating an authentication failure.
func NewHTTPErr ¶
NewHTTPErr constructs a new HTTP error wrappered with pkg/errors error.
Types ¶
type FatalErr ¶
type FatalErr struct {
ServerErr
}
FatalErr is a server error that is will prevent the server/CA from continuing to operate
func NewFatalError ¶
NewFatalError constructs a fatal error
type HTTPErr ¶
type HTTPErr struct {
// contains filtered or unexported fields
}
HTTPErr is an HTTP error.
func CreateHTTPErr ¶
CreateHTTPErr constructs a new HTTP error.
func (*HTTPErr) GetLocalCode ¶
GetLocalCode returns the local error code
func (*HTTPErr) GetLocalMsg ¶
GetLocalMsg returns the local error message
func (*HTTPErr) GetRemoteCode ¶
GetRemoteCode returns the remote error code
func (*HTTPErr) GetRemoteMsg ¶
GetRemoteMsg returns the remote error message
func (*HTTPErr) GetStatusCode ¶
GetStatusCode returns the HTTP status code
Click to show internal directories.
Click to hide internal directories.