-
Notifications
You must be signed in to change notification settings - Fork 15
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
Better error handling #61
Conversation
"format": "application/pdf", | ||
"label": "Download as PDF" | ||
}, | ||
"seeAlso": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug in o'sullivan--a list should be allowed for seeAlso
def self.from_ordered_hash(hsh, default_klass=IIIF::OrderedHash) | ||
unless hsh.is_a? Hash | ||
raise IIIF::Service::ExpectedHashError, "expected a hash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a custom error here, wouldn't ArgumentError
suffice?
end | ||
else | ||
new_object[new_key] = hsh[key] | ||
rescue ExpectedHashError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer we don't do flow control with exceptions. Can we check that hsh[key]
and member
are hashes here?
This pull request has been replaced by #68 and may be closed. |
Closing this in favor of #68 |
No description provided.