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

enh: display error popup when import preview fails #1463

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

enjeck
Copy link
Contributor

@enjeck enjeck commented Nov 16, 2024

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

@enjeck enjeck self-assigned this Nov 16, 2024
@enjeck enjeck added 3. to review Waiting for reviews enhancement New feature or request labels Nov 16, 2024
@blizzz
Copy link
Member

blizzz commented Nov 18, 2024

Definitely an improvement!

Maybe we still can do update this screen as well?

Screenshot_20241118_111641

Cause it keep idling and the notification on the top right may escape the eye.

@juliusknorr
Copy link
Member

Agreed, let's switch to a proper error screen

@enjeck enjeck requested a review from blizzz as a code owner November 27, 2024 07:49
@enjeck enjeck force-pushed the show-preview-import-error branch from 71438d9 to 10bd6a9 Compare November 27, 2024 07:49
@enjeck
Copy link
Contributor Author

enjeck commented Nov 27, 2024

Now, it shows this:
image

@enjeck enjeck force-pushed the show-preview-import-error branch from 10bd6a9 to bc6fe9f Compare November 30, 2024 10:52
@enjeck enjeck requested review from a team and juliusknorr and removed request for a team December 5, 2024 09:23
Comment on lines +292 to +304
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)
}
Copy link
Member

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.'))
Copy link
Member

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) {
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

3 participants