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

Remove as many generic error() messages from base as possible #9837

Merged
merged 1 commit into from
Jan 22, 2015

Conversation

jakebolewski
Copy link
Member

  • throw more specific Exception types
  • make error messages more consistent
  • give more context for the error when possible
  • update tests

@tkelman tkelman added the domain:error handling Handling of exceptions by Julia or the user label Jan 19, 2015
@@ -21,9 +21,9 @@ end

function IPv4(host::Integer)
if host < 0
error("IP address must not be negative")
throw(ArgumentError("IPv4 address must not be ≥ 0"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the sense on this statement wrong? The IPv4 must be positive.

Copy link
Member

Choose a reason for hiding this comment

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

Do these inequality symbols display correctly on Windows?

Copy link
Member Author

Choose a reason for hiding this comment

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

@GlenHertz thanks for reading through. "must be positive" I think is subjectively better than "not negative", I'll push an update.

@IainNZ I have no idea.

@ViralBShah
Copy link
Member

This is great, and much needed.

@jakebolewski jakebolewski changed the title Try and remove as many generic error() messages from base as possible Remove as many generic error() messages from base as possible Jan 19, 2015
 * throw more specific Exception types
 * make error messages more consistent
 * give more context for the error when possible
 * update tests
@jakebolewski
Copy link
Member Author

I've updated with @GlenHertz's suggestions and did another pass over what I pushed last night. I also updated some of the errors in the LinearAlgebra module.

@IainNZ
Copy link
Member

IainNZ commented Jan 20, 2015

Really nice work @jakebolewski !

@staticfloat
Copy link
Sponsor Member

👍

jakebolewski added a commit that referenced this pull request Jan 22, 2015
Remove as many generic error() messages from base as possible
@jakebolewski jakebolewski merged commit 03e2d1d into master Jan 22, 2015
@jakebolewski jakebolewski deleted the jcb/bettererrs branch January 22, 2015 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants