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

Improve error handling of user input and API responses #4083

Open
magicznyleszek opened this issue Oct 17, 2022 · 2 comments
Open

Improve error handling of user input and API responses #4083

magicznyleszek opened this issue Oct 17, 2022 · 2 comments
Assignees
Labels
bug Things broken and not working as expected Front end

Comments

@magicznyleszek
Copy link
Member

magicznyleszek commented Oct 17, 2022

Description

Ideally this should be done on feature/nlp branch. We should probably introduce some onBackendError (handleBackendError?) utility method that should be imported and used everywhere we want to observe API call failures. It could be passed directly or if we require some more handling in some cases, (response) => {onBackendError(response); <more code>}.

A card from NLP QA board says:

single processing view shows {'detail': 'whatever'} in errors instead of unwrapping the detail

to reproduce: log out in another tab and click "begin" on the transcript screen.

additional: if you stop your kpi (python) server and click "begin", you'll see a toast notification with the red X indicator but no error text.

Additional details

Zulip topic

@magicznyleszek magicznyleszek added bug Things broken and not working as expected Front end labels Oct 17, 2022
@jnm
Copy link
Member

jnm commented Oct 30, 2022

I added a quick workaround (@dorey's) on the 3939-knowncols+qa-fixes branch just to prepare for the imminent NLP deployment:
5b3bb0c

There's going to be a lot more NLP QA work after the initial, invitation-only release, so this can continue on top of feature/nlp (or just on top of beta if that's easier). Thanks 👍

@magicznyleszek
Copy link
Member Author

feature/regional_projects introduces a function named handleApiFail https://github.com/kobotoolbox/kpi/blame/86e8e14f5a8591fff5ca84b67211eb5a5eaae2a8/jsapp/js/utils.ts#L75

@magicznyleszek magicznyleszek changed the title Fix backend error notification handling Improve error handling of user input and API responses Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things broken and not working as expected Front end
Projects
None yet
Development

No branches or pull requests

3 participants