-
Notifications
You must be signed in to change notification settings - Fork 66
Conversation
Sorry for the delay, I had to think about this one. Will review later today ! |
ciri/api/http/http.c
Outdated
retcode_t ret = RC_OK; | ||
|
||
if (*error == NULL) { | ||
if (message == NULL) { | ||
if (message == NULL && status_code == MHD_HTTP_INTERNAL_SERVER_ERROR) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this &&
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally thought I should use Bad request
as dfault error status code.
I will change &&
to ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should I do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove message == NULL
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove && status_code == MHD_HTTP_INTERNAL_SERVER_ERROR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
retcode_t ret = RC_OK; | ||
|
||
if (*error == NULL) { | ||
if (message == NULL) { | ||
if (message == NULL && status_code == MHD_HTTP_INTERNAL_SERVER_ERROR) { | ||
*error = error_res_new("Internal server error"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add status_code
as parameter to error_res_new
?
Since you opened this PR, I started working on a gRPC API. |
got it! cheer up |
Won't be merged due to ciri being discontinued and entangled soon being archived. |
Add arg
status_code
toerror_serialize_response()
Return status code 400 if no message and no status code was specified.
fixes #1085