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

Error message "Make sure you're connected to the internet" when posting links with non-link text #54

Open
Roopappy opened this issue Mar 30, 2024 · 1 comment

Comments

@Roopappy
Copy link

Reproduced on iPhone using Firefox (really Safari), and Linux using Firefox.

Create a new post of type "Link" and add a link, but then line break and add additional text, then try to submit the post.

The error message "Make sure you're connected to the internet" comes up.
If you try to submit again, you get a "Whoa, slow down there" error.

I believe this should be an error about failing the link validation, but the error that comes up is confusing to the user.

image

@Codycody31
Copy link
Contributor

Interesting, that would probably need to be fix here, as it seems it just uses a generic message. Maybe we could instead check client side on the page to ensure it conforms correctly and notify the user there?

export const snackAlertError = (error) => {
console.error(error);
if (error instanceof APIError) {
if (error.status === 429) {
return snackAlert('Whoah, slow down there!', 'too_many_requests');
}
}
if (error instanceof TypeError) {
return snackAlert(`Make sure you're connected to the internet`, 'network_error');
}
return snackAlert('Something went wrong.', 'generic');
};

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

No branches or pull requests

2 participants