-
Notifications
You must be signed in to change notification settings - Fork 130
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
[MM-933] Updated code to display proper errors on UI #986
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ export default class JiraAutoCompleteSelector extends React.PureComponent<Props> | |
value: suggestion.value, | ||
label: stripHTML(suggestion.displayName), | ||
})); | ||
}).catch((e) => { | ||
throw new Error('Error fetching data'); | ||
Kshitij-Katiyar marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are sort of "swallowing" this error here. Is the error present in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mickmister I don't think the errors are helpful for the user. You can check the errors returned in this PR only. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess I'm wondering why we're returning an error from the API if we're not using it on the frontend though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mickmister We want to show the error to the user in case we are unable to fetch the data. If we don't send the error from the API we won't be able to display the generic error. Please correct me if I am wrong There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright that makes sense |
||
}); | ||
}; | ||
|
||
|
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 notice we're not calling
respondErr
here. I think that's intentional since this error is coming from a failure to write a responseThere 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.
@mickmister We were not calling
respondErr
anywhere in the function. I think we should as the user will not see any data in the dropdown in this case as well. Please let me know your thoughts on this.