Skip to content

Conversation

@petershintech
Copy link
Contributor

Would be better to be specific about the type of an error when raising and handling exceptions.

ln = m.line
if ln <= 0
error("could not determine location of method definition")
throw(ArgumentError("could not determine location of method definition"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 To most of these changes. I'm not sure this one is an argument error though; it doesn't really seem like the caller's fault.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Not sure when we have this kind of case. Any suggestion for a more specific exception type rather than throwing a general ExceptionError?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes an ErrorException is the best fit, might be so here.

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

Successfully merging this pull request may close these issues.

3 participants