-
Notifications
You must be signed in to change notification settings - Fork 274
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
Add network error message #1281
Conversation
Check if the URL is correct and the server is reachable. | ||
If it's reachable, the server might be blocking the request. | ||
Check the console and network for more information. | ||
In case of a CORS error, you can try using a proxy server. |
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.
Can we infer what type of error was that and provide a dedicated message outlining the next steps? For example:
- If it's a network error – say your internet connection twitched and reloading the page should fix the issue.
- If it's 404 – say file couldn't be found.
- If it's 403 – say it's probably a private resource.
- If it's a CORS error, provide a paragraph or two of text to explain it's a browser security thing, provide a link that explains what's CORS, say they need to move their file somewhere else, e.g. GitHub / raw.githubusercontent.com, link out to a resource explaining setting up CORS headers on their existing servers.
All of these came up in various chats. A good error message will provide the reader with an explanation and the next steps. Ideally the reader will have all they need and won't ask us any follow-up questions. If there are no good external reliable resources we could link to, we could add a doc page to link to.
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.
Fetch returns a type error when a network error occurs without details. This means we can't distinguish between different types of network errors.
404 is special so it will return a response and our code will return_Could not download_.
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.
Oh bummer! Well, let's provide a longer writeup, then, to at least explain what to do next, even if that's just "Glance at your console, what do you see? 404? do X. CORS? do Y". It could even be a link to a documentation page.
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.
I updated the message, let me know if it's still unclear.
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.
Now I understand what you mean by longer writeup 😄
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.
Thank you!
Co-authored-by: Adam Zielinski <adam@adamziel.com>
raw.githubusercontent.com instead. Here's how to do that: | ||
1. Start with the original GitHub URL for the file. For example: | ||
``` |
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.
Ooops, this terminates a string and I broke the JS syntax :D
Fixes #1205
What is this PR doing?
It adds an error message for blueprint network errors.
What problem is it solving?
It will help users identify the root cause of blueprints failing.
How is the problem addressed?
By returning a custom error message with debug instructions.
Testing Instructions
Note: The error is currently displayed multiple times because of uncaught promises somewhere in the code.