Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
 - func Errorhandler(err string, h http.HandlerFunc)
 - func Exception(errcode string, w http.ResponseWriter, r *http.Request, msg string)
 - func Forbidden(rw http.ResponseWriter, r *http.Request)
 - func InternalServerError(rw http.ResponseWriter, r *http.Request)
 - func NotFound(rw http.ResponseWriter, r *http.Request)
 - func RegisterErrorHandler()
 - func ServiceUnavailable(rw http.ResponseWriter, r *http.Request)
 - func ShowErr(err interface{}, rw http.ResponseWriter, r *http.Request, Stack string)
 - func SimpleServerError(rw http.ResponseWriter, r *http.Request)
 - func Unauthorized(rw http.ResponseWriter, r *http.Request)
 - type HTTPException
 
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  var ErrorMaps map[string]http.HandlerFunc
    map of http handlers for each error string.
      View Source
      
  var HTTPExceptionMaps map[int]HTTPException
    map of http exceptions for each http status code int. defined 400,401,403,404,405,500,502,503 and 504 default.
Functions ¶
func Errorhandler ¶
func Errorhandler(err string, h http.HandlerFunc)
add http handler for given error string.
func Exception ¶
show error string as simple text message. if error string is empty, show 500 error as default.
func InternalServerError ¶
func InternalServerError(rw http.ResponseWriter, r *http.Request)
show 500 internal server error.
func RegisterErrorHandler ¶
func RegisterErrorHandler()
register default error http handlers, 404,401,403,500 and 503.
func ServiceUnavailable ¶
func ServiceUnavailable(rw http.ResponseWriter, r *http.Request)
show 503 service unavailable error.
func ShowErr ¶
func ShowErr(err interface{}, rw http.ResponseWriter, r *http.Request, Stack string)
    render default application error page with error and stack string.
func SimpleServerError ¶
func SimpleServerError(rw http.ResponseWriter, r *http.Request)
show 500 internal error with simple text string.
func Unauthorized ¶
func Unauthorized(rw http.ResponseWriter, r *http.Request)
show 401 unauthorized error.
Types ¶
      
      Source Files
      ¶
    
- error.go
 - exceptions.go
 - i18n.go
 
 Click to show internal directories. 
   Click to hide internal directories.