Skip to content

Commit

Permalink
Improve APIError message
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Oct 31, 2024
1 parent 0c45d61 commit b9a1ab6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pachca.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ func (d *Date) UnmarshalJSON(b []byte) error {

// Error returns error text
func (e APIError) Error() string {
return fmt.Sprintf("(%s) %s [%s:%s]", e.Code, e.Message, e.Key, e.Value)
return fmt.Sprintf(
"(%s) %s [%s:%s]",
e.Code, e.Message, e.Key, strutil.Q(e.Value, "-"),
)
}

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down

0 comments on commit b9a1ab6

Please sign in to comment.