Skip to content
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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

knorris
Copy link
Collaborator

@knorris knorris commented Oct 18, 2016

No description provided.


if (searchResults.error) {
const {message} = searchResults.error
const spanStyle = {...style.span, color: 'red'}
Copy link
Owner

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}

Copy link
Collaborator Author

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 {
Copy link
Owner

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?

Copy link
Owner

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?

Copy link
Collaborator Author

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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sane reason as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants