-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SourceProvider and ReactionProvider error message #41
Conversation
@ruokun-niu does this include a unit test for the error that I reported to validate that it is resolved? |
Hmm we actually don't have any unit tests for the control plane stuff. I manually tested this with some examples. |
DomainError::NotFound => HttpResponse::NotFound().body("Resource not found"), | ||
DomainError::Invalid { message } => HttpResponse::BadRequest().body(message), | ||
DomainError::NotFound => HttpResponse::NotFound().body(" Resource not found"), | ||
DomainError::Invalid { message } => HttpResponse::BadRequest().body(" ".to_string() + &message), |
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 would we add a space to the beginning of the error message?
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 think it's because when we did without the space, the response after using the CLI (e.g. response from a drasi apply
command) will look a bit weird
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.
like the body message will be just concatenated with the status code, making it difficult to read
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 think the space should be in the CLI when it displays it. Otherwise, someone calling the API without the CLI will see error messages with a prefixed space.
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.
Oh right good point. Thanks
|
||
#[error("JsonParseError")] | ||
JsonParseError { | ||
kind: String, |
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.
is kind
meant to be message
?
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 forgot why I used the word kind
as I was trying to capture the type
of the json value. Maybe message
is a better choice
Description
DomainError
Type of change
Fixes: https://dev.azure.com/azure-octo/Incubations/_boards/board/t/Drasi/User%20Stories?workitem=13122