-
Notifications
You must be signed in to change notification settings - Fork 1
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
Closes #267. Show error message from queries #272
base: dev
Are you sure you want to change the base?
Conversation
|
||
if (searchResults.error) { | ||
const {message} = searchResults.error | ||
const spanStyle = {...style.span, color: 'red'} |
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.
Should use the red color from material-ui so that we have consistent colors.
import {red500} from 'material-ui/styles/colors'
//...
const spanStyle = {...style.span, color: red500}
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
const spanStyle = {...style.span, color: 'red'} | ||
let text = {} | ||
|
||
try { |
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 there a reason we are doing this here and not inside the action?
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.
Another point here is why are we interpretting the "data" sent back from the rest side. why doesn't the rest side just figure out what to send and send it back as a 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.
This was so REST could send an error in any format. Sometimes we want the error formatted to display to a user. For example:
You do not have the correct LACs/COIs to view this data:
LACs: 123_456
COIs: ABC_DEF
A string does not allow this.
let text = {} | ||
|
||
try { | ||
text = JSON.parse(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.
same comments as above.
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.
sane reason as above
2ba7200
to
83ecf31
Compare
No description provided.