-
Notifications
You must be signed in to change notification settings - Fork 25
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
enh: display error popup when import preview fails #1463
base: main
Are you sure you want to change the base?
Conversation
Agreed, let's switch to a proper error screen |
71438d9
to
10bd6a9
Compare
Signed-off-by: Cleopatra Enjeck M. <[email protected]>
Signed-off-by: Cleopatra Enjeck M. <[email protected]>
10bd6a9
to
bc6fe9f
Compare
if (res.status === 401) { | ||
console.debug('error while importing', res) | ||
showError(t('tables', 'Could not import, not authorized. Are you logged in?')) | ||
} else if (res.status === 403) { | ||
console.debug('error while importing', res) | ||
showError(t('tables', 'Could not import, missing needed permission.')) | ||
} else if (res.status === 404) { | ||
console.debug('error while importing', res) | ||
showError(t('tables', 'Could not import, needed resources were not found.')) | ||
} else { | ||
showError(t('tables', 'Could not import data due to unknown errors.')) | ||
console.debug('error while importing', res) | ||
} |
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.
We could actually show the error message as the empty content description instead of another showError toast message.
} | ||
} catch (e) { | ||
showError(t('tables', 'Could not import data due to unknown errors.')) |
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 for this and the ones below
} else { | ||
showError(t('tables', 'Could not import data due to unknown errors.')) | ||
console.debug('error while importing', res) | ||
if (res.status === 401) { |
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.
Seems like some code duplication, maybe we can move the error handling into a shared method?
Right now, at #1440, when the import fails, there's no error visible to the user. So, this adds an error popup so the user knows that there was a problem