package
Version:
v1.0.0-...-4f7f1ef
Opens a new window with list of versions in this module.
Published: May 31, 2016
License: LGPL-3.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
martini enhanced return handler
Usage
package main
import (
"fmt"
"github.com/go-martini/martini"
"github.com/martini-contrib/render"
"github.com/tsaikd/KDGoLib/martini/errorJson"
)
func main() {
m := martini.Classic()
m.Map(errorJson.ReturnErrorProvider())
m.Use(render.Renderer())
m.Get("/", func() err {
return fmt.Errorf("error")
})
m.Run()
}
Documentation
¶
BindMartini bind return error handler to martini instance
RenderErrorJSON render error in json format
type ReturnError struct {
Status int
Body []byte
Error error
}
ReturnError define api function call return error struct
AddError add error to ReturnError
Source Files
¶
Click to show internal directories.
Click to hide internal directories.