LivelyKernel / LivelyKernel/lively.next

Inadequate error messages on `resource.read()` failure

Open
#748 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

✨ enhancement
Dominant language
JavaScript
Stars
90
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Incomplete error message in failure to load resource. When there's a failure due to CORS access policy (the seventh hell of the Internet), the error message from Lively is: TypeError: Failed to fetch
Whereas if I look at the debug console, I see:

Access to fetch at 'http://127.0.0.1:5000/list_user_dashboards/rick.mcgeer@engageLively.com' from origin 'http://127.0.0.1:9011' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

It's pretty easy to fix once I've looked at the debug console, but it would have saved me a step if the error message had been reproduced in Lively (and it's not clear the users we're targeting will go to the debug console)

To Reproduce
Attempt to load an http resource without specifying CORS policy at the server.

Screenshots

Screenshot 2023-03-07 182324
Screenshot 2023-03-07 182356

Setup
Please check the applicable boxes:

  • Windows

Version: Please paste the lively.next commit on which the problem occurred here (short version from the Version Checker in the bottom left corner is sufficient).
0e22dbdb9416630eaf14c02b4da607af029b508d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the resource.read() entry point and reproduce the failed HTTP load against a server without the required CORS header. Compare the error surfaced by Lively with the browser console message; done means the user-facing failure includes useful CORS context rather than only TypeError: Failed to fetch.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.