We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9d92492 + 9782b32 commit bdde937Copy full SHA for bdde937
1 file changed
errors.go
@@ -271,6 +271,11 @@ func (e *AsertoError) WithHTTPStatus(httpStatus int) *AsertoError {
271
// and if there are details from multiple errors, the aserto error will be constructed based on the first one.
272
func FromGRPCStatus(grpcStatus status.Status) *AsertoError {
273
var result *AsertoError
274
+
275
+ if len(grpcStatus.Details()) == 0 {
276
+ return ErrUnknown.Msg(grpcStatus.Message())
277
+ }
278
279
for _, detail := range grpcStatus.Details() {
280
if t, ok := detail.(*errdetails.ErrorInfo); ok {
281
result = asertoErrors[t.Domain]
@@ -283,6 +288,7 @@ func FromGRPCStatus(grpcStatus status.Status) *AsertoError {
283
288
break
284
289
}
285
290
291
286
292
return result
287
293
294
0 commit comments