report errors via JSON

This reflects the latest SPEC draft.
This commit is contained in:
Eugene Yakubovich
2015-04-29 17:52:41 -07:00
parent c24708ff62
commit c7a1442830
3 changed files with 32 additions and 9 deletions

View File

@ -48,6 +48,12 @@ type Route struct {
GW net.IP
}
type Error struct {
Code uint `json:"code"`
Msg string `json:"msg"`
Details string `json:"details,omitempty"`
}
// net.IPNet is not JSON (un)marshallable so this duality is needed
// for our custom ip.IPNet type