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

Fold all the exception types up into 007 types #245

Open
masak opened this issue Aug 28, 2017 · 2 comments
Open

Fold all the exception types up into 007 types #245

masak opened this issue Aug 28, 2017 · 2 comments

Comments

@masak
Copy link
Owner

masak commented Aug 28, 2017

As I'm working along with #242, I was reminded that there's still a fair bit of technical debt in the code base in the form of Perl 6-level exceptions that ought to be 007-level exceptions.

Specifically, we rely quite a bit on Perl 6's own language-level exceptions (those thrown by the Perl 6 compiler), and that ties us unnecessarily to Perl 6.

For each exception throwing site that we "lift" into 007, it would be nice to have a corresponding test. We ought to be able to have all those tests without implementing a catch mechanism in 007, since all we care about is the exception bubbling up to the top level and aborting the program. As usual, we want to test not just the type of the exception, but all its pertinent data, too.

@masak
Copy link
Owner Author

masak commented Sep 18, 2017

After we do this one, we might also consider reducing the exception types to the bare minimum. Python is quite exemplary here: many exceptions come down to ValueError, LookupError, or TypeError.

Java is also praiseworthy: even though it has many, many exception types in its standard library, many exceptions can be reduced to either IllegalArgumentException or IllegalStateException.

There needs to be a distinction between exception types when we expect to ever use that distinction by type-matching into differen categories. If we don't expect to do that, we might as well simplify the exception hierarchy in places where we can.

@masak
Copy link
Owner Author

masak commented Aug 2, 2018

At this stage we have both runtime-error and throws-exception in _007::Test. The former expects a Perl 6 exception; the latter a 007 exception.

When this issue has been resolved, there should only be a need for the latter kind.

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

No branches or pull requests

1 participant