Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Log Jason.decode errors #113

Closed
acco opened this issue Feb 3, 2024 · 3 comments
Closed

Log Jason.decode errors #113

acco opened this issue Feb 3, 2024 · 3 comments

Comments

@acco
Copy link
Contributor

acco commented Feb 3, 2024

Any particular reason to silently ignore Jason.decode errors here?

https://github.com/woutdp/live_svelte/blob/master/lib/component.ex#L129

This results in the downstream error of <MyComponent was created without expected prop 'my_prop'>, which hides the core issue (that the prop you passed in was not Jason decodable).

Unless I'm missing something, two options:

  • Log out on error
  • Raise on error

What do you think? 🙏

@woutdp
Copy link
Owner

woutdp commented Feb 4, 2024

Not sure why I ignored it, been a while since I looked at that code.

Any of the 2 proposed solutions would be fine with me. Feel free to create a PR.

@acco
Copy link
Contributor Author

acco commented Feb 5, 2024

Thanks! I figured a raise was most explicit, couldn't think of a good reason to fail quietly

#114

@woutdp
Copy link
Owner

woutdp commented Apr 12, 2024

Fixed in: #114

@woutdp woutdp closed this as completed Apr 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants