Skip to content

Commit

Permalink
Convert bfg to new protocol errors
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopeereboom committed Feb 27, 2024
1 parent 1d3540c commit 8164f88
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 151 deletions.
8 changes: 8 additions & 0 deletions api/protocol/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ func WireError(err error) *Error {
}
}

// WireErrorf creates a protocol error for the client.
func WireErrorf(msg string, args ...any) *Error {
return &Error{
Timestamp: time.Now().Unix(),
Message: fmt.Sprintf(msg, args...),
}
}

// InternalError is an error type that differentiates between caller and callee
// errors. An internal error is used when something internal to the application
// fails. The client should not see the actual error message as those are
Expand Down
Loading

0 comments on commit 8164f88

Please sign in to comment.