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

throw/1 is not implemented. raise/1 does not work #359

Closed
vans163 opened this issue Aug 24, 2017 · 5 comments
Closed

throw/1 is not implemented. raise/1 does not work #359

vans163 opened this issue Aug 24, 2017 · 5 comments
Labels
Milestone

Comments

@vans163
Copy link
Contributor

@vans163 vans163 commented Aug 24, 2017

Uncaught TypeError: ElixirScript.Core.erlang.__throw__ is not a function
raise(:atom)

Uncaught ReferenceError: atom is not defined

Perhaps it should be added to here #306?

@bryanjos
Copy link
Collaborator

@bryanjos bryanjos commented Aug 26, 2017

I made a PR to fix throw compilation. For the raise example, it expects either a string or a module/atom which it calls exception on. So the above would not work. https://hexdocs.pm/elixir/Kernel.html#raise/1

@vans163
Copy link
Contributor Author

@vans163 vans163 commented Aug 27, 2017

bad example

raise("atomm")

Uncaught Tuple {values: Array(2), length: 2}

Its not very informative, perhaps can be improved to look like an actual raise occured?

@bryanjos
Copy link
Collaborator

@bryanjos bryanjos commented Aug 27, 2017

Errors should definitely be improved. Raise eventually calls :erlang.error passing to it the result of Exception.exception/1. The implementation of erlang.error can be improved to show errors that look closer to what is expected

@bryanjos
Copy link
Collaborator

@bryanjos bryanjos commented Aug 28, 2017

Reopening so discussion is seen

@bryanjos
Copy link
Collaborator

@bryanjos bryanjos commented Sep 9, 2017

Error messages from raise or :erlang.error should now look like ones from Elixir

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

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.