Skip to content

Commit

Permalink
include deepgram specific error message in StatusError.Error
Browse files Browse the repository at this point in the history
  • Loading branch information
cbodonnell committed Oct 29, 2024
1 parent 30cd597 commit 1d071bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/client/interfaces/v1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,8 @@ type StatusError struct {

// Error string representation for a given error
func (e *StatusError) Error() string {
if e.DeepgramError != nil && e.DeepgramError.ErrMsg != "" {
return fmt.Sprintf("%s %s: %s - %s", e.Resp.Request.Method, e.Resp.Request.URL, e.Resp.Status, e.DeepgramError.ErrMsg)
}
return fmt.Sprintf("%s %s: %s", e.Resp.Request.Method, e.Resp.Request.URL, e.Resp.Status)
}

0 comments on commit 1d071bc

Please sign in to comment.