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

Is there a good way of throwing Runtime errors while running Repl? #36

Closed
danvim opened this issue Dec 2, 2016 · 6 comments
Closed

Comments

@danvim
Copy link

danvim commented Dec 2, 2016

This library is absolutely a wonderful treasure I've found. Thank you.


The solution might already exist, if that's the case, then I couldn't find it. Perhaps writing a documentation would attract more people using it?

Anyway, Is there a way to elegantly abort evaluation with a runtime error message similar to parser.abort()? For example, divide-by-zero error or arithmetic errors. I just don't want to see a log from Java. Or do I have to extend Repl? In any case, I think it would be a good thing to have a switch on whether or not to dump the whole error log while running Repl.

@atorstling
Copy link
Owner

Hi @danvim . Nice to see I have a user! Thanks for the praise :) I can absolutely add some more documentation. If would be great if you could describe what you would like to see documented or improved, so I can start with the most important parts.

What you say regarding the Repl makes a lot of sense. So I've reverted the default behavior in Repl. It now propagates all exceptions by default. I also added functionality for specifying parsing and evalution functions to swallow and resume if needed. You can see examples of this in ReplTest.

Could you try the master branch to see if it works for you now? When you're happy, I can release a new version.

@danvim
Copy link
Author

danvim commented Dec 3, 2016

Wow! Thank you for your quick response! Honestly, I thought this great piece of work was already covered in dust. I'll try it out very soon. Meanwhile, I need to post another issue :P

@atorstling
Copy link
Owner

No worries! I'm using this lib for my site http://durat.io , so it's being kept alive. I was thinking we could move to stackoverflow for the questions, so that they are more visible. Do you have an account there? If so, create your questions there under #bychan and ping me, and I'll start subscribing to the tag.

@danvim
Copy link
Author

danvim commented Dec 3, 2016

@atorstling thanks, will do, I have an account there

@atorstling
Copy link
Owner

Is the code working for you? Can I close the issue?

@danvim
Copy link
Author

danvim commented Dec 4, 2016

Yes, you can close the issue, thanks! :)

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

2 participants