forked from chartmuseum/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Logging errors from ChartMuseum, added support for organizations in CM
- Added Error model to deserialize json errors from ChartMuseum into. - Changed panic logging to use message from error model - Added option to use ChartMuseum/ui with ChartMuseums that use organizations
- Loading branch information
1 parent
f45c32a
commit 2b92700
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package models | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
type Error struct { | ||
Message string `json:"error"` | ||
} | ||
|
||
func NewError(data []byte) (Error, error) { | ||
var e Error | ||
err := json.Unmarshal(data, &e) | ||
return e, err | ||
} |