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 for improper URLs are attributed to incorrect line #609

Open
hallpell opened this issue Jan 18, 2022 · 3 comments
Open

Error message for improper URLs are attributed to incorrect line #609

hallpell opened this issue Jan 18, 2022 · 3 comments

Comments

@hallpell
Copy link
Collaborator

In this example:

https://woofjs.com/create.html#hallpell_url-error

the error occurs in line 9 (where no URL is provided to setImageURL), but Woof reports the error on line 1. Need to process this error differently in some way.

@hallpell
Copy link
Collaborator Author

It looks like we've already tried to deal with this by scanning through the code (regex-style) to look for Empty URL Types (

if (error.url === "") {
), but we're missing some cases. Three main cases that I think are missing are:

  • I don't think it ignores whitespace
  • If no argument is provided (which appears as 'undefined' once it gets inside woof.js and thrown as an ImageLoadError)
  • If an empty variable is provided as an argument, we're probably not going to be able to track it down regex-style, and would need to track the error from where it was thrown, which requires upgrading our architecture a bit.

I should be able to clean up the first two cases a bit fairly easily, so should be able to get that done soon.

@hallpell
Copy link
Collaborator Author

(Also setBackdropURL has an error message if a string isn't provided as the first argument, which should be added to setImageURL as well)

@hallpell
Copy link
Collaborator Author

Further investigation of this makes me not trust how we handle errors in Woof. I believe when we try to GET an image that doesn't exist, we throw two errors. The 404 error seems to not be caught properly, and is making it hard for me to properly track down how the errors are propagating.

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

1 participant