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

Allow error message to be display in notice #59

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

Allow error message to be display in notice #59

wants to merge 1 commit into from

Conversation

mpandzo
Copy link

@mpandzo mpandzo commented Dec 9, 2019

Allow error message to be returned from server side (and displayed in notice) together with success: 0 in the following form:

{
     "success": "0",
     "message": "File too large"
}

cc @neSpecc

Allow error message to be returned from server side (and displayed in notice) together with success: 0 in the following form:

```
{
     "success": "0",
     "message": "File too large"
}
```
@mpandzo
Copy link
Author

mpandzo commented Dec 16, 2019

@neSpecc any news with regards this? Thanks.

@tylerwiegand
Copy link

This would be really nice. I'm currently factoring my code to support this format, makes a ton of sense.

@hagemann
Copy link
Contributor

hagemann commented Apr 8, 2020

Would be fantastic if this could be merged. A custom error message is badly needed (especially because the current error message is grammatically wrong).

@syssam
Copy link

syssam commented Feb 15, 2021

any news?

@ataylor32
Copy link

I, too, think this is an important change that should be made. My main use case for it is for when a user's session expires (or they log out in another tab). Currently, the message they get when an upload fails in this scenario is "Couldn’t upload image. Please try another.", which causes users to think that there's something wrong with the particular image they chose. It would be nice to be able to tell them that they're logged out and need to log back in.

@asaldanam
Copy link

Hi! any news about this? ATM error message displayed by notifier cannot be customized in any way.

@neSpecc neSpecc added the good first issue Good for newcomers label Sep 5, 2022


let errorMessage = 'Can not upload an image, try another.';
let errorJson = JSON.parse(errorText);
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to parse JSON, because it is already parsed in the method above. Use the errorText argument instead.

if (errorJson.hasOwnProperty('message')) {
errorMessage = errorJson.message;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

also, update a readme describing that feature

@robonetphy
Copy link
Member

Hey @mpandzo can you pls provide the access to your fork so I can update the PR.

@tech-magnety-ai
Copy link

I've submitted another PR to implement this improvement: #245.

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

Successfully merging this pull request may close these issues.

9 participants