Skip to content

Commit b3a7bd1

Browse files
committed
expose cmd.toAPIError()
1 parent 988efd8 commit b3a7bd1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/api-errors.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,10 @@ func toAPIError(ctx context.Context, err error) APIError {
19861986
return apiErr
19871987
}
19881988

1989+
func ToAPIError(err error) APIError {
1990+
return toAPIError(context.Background(), err)
1991+
}
1992+
19891993
// getAPIError provides API Error for input API error code.
19901994
func getAPIError(code APIErrorCode) APIError {
19911995
if apiErr, ok := errorCodes[code]; ok {

0 commit comments

Comments
 (0)