Skip to content

Commit

Permalink
docs: fix output examples for ToJSON (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarnikowski authored Feb 13, 2023
1 parent a946296 commit d0c56b6
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions format.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,32 +123,32 @@ func NewDefaultJSONFormat(options FormatOptions) JSONFormat {
// An error without trace will be formatted as follows:
//
// {
// "root": [
// {
// "root": {
// "message": "Root error msg"
// },
// "wrap": [
// {
// "message": "Wrap error msg"
// }
// ],
// "wrap": {
// "message": "Wrap error msg"
// }
// ]
// }
//
// An error with trace will be formatted as follows:
//
// {
// "root": [
// "root": {
// "message": "Root error msg",
// "stack": [
// "<Method2>:<File2>:<Line2>",
// "<Method1>:<File1>:<Line1>"
// ]
// },
// "wrap": [
// {
// "message": "Root error msg",
// "stack": [
// "<Method2>:<File2>:<Line2>",
// "<Method1>:<File1>:<Line1>"
// ]
// "message": "Wrap error msg",
// "stack": "<Method2>:<File2>:<Line2>"
// }
// ],
// "wrap": {
// "message": "Wrap error msg",
// "stack": "<Method2>:<File2>:<Line2>"
// }
// ]
// }
func ToJSON(err error, withTrace bool) map[string]interface{} {
return ToCustomJSON(err, NewDefaultJSONFormat(FormatOptions{
Expand Down

0 comments on commit d0c56b6

Please sign in to comment.