Skip to content

Commit a15f1ac

Browse files
committed
httpcommand: when fails, add command key to error message
1 parent d0a1b80 commit a15f1ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

httpcommand/httpcommand.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package httpcommand
44

55
import (
66
"encoding/json"
7+
"fmt"
78
"net/http"
89
"time"
910

@@ -113,6 +114,7 @@ func InvokeSkippingAuthorization(
113114
invoker command.Invoker,
114115
eventLog eventlog.Log,
115116
) *HttpError {
117+
cmdStruct.Key()
116118
if errValidate := cmdStruct.Validate(); errValidate != nil {
117119
return badRequest("command_validation_failed", errValidate.Error())
118120
}
@@ -122,7 +124,7 @@ func InvokeSkippingAuthorization(
122124
if httpErr, is := errInvoke.(*HttpError); is {
123125
return httpErr // use as-is
124126
} else {
125-
return badRequest("command_failed", errInvoke.Error())
127+
return badRequest("command_failed", fmt.Sprintf("%s: %s", cmdStruct.Key(), errInvoke.Error()))
126128
}
127129
}
128130

0 commit comments

Comments
 (0)