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

Better error handling #61

Closed
wants to merge 4 commits into from
Closed

Conversation

saracarl
Copy link

No description provided.

"format": "application/pdf",
"label": "Download as PDF"
},
"seeAlso": [
Copy link

@jpstroop jpstroop Oct 19, 2016

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"
Copy link
Collaborator

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
Copy link
Collaborator

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?

@benwbrum
Copy link
Collaborator

benwbrum commented Oct 4, 2017

This pull request has been replaced by #68 and may be closed.

@saracarl
Copy link
Author

saracarl commented Oct 4, 2017

Closing this in favor of #68

@saracarl saracarl closed this Oct 4, 2017
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.

4 participants