Skip to content

API return values (null values vs. Exceptions, framing) #13

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

Closed
lanthaler opened this issue Aug 24, 2011 · 3 comments
Closed

API return values (null values vs. Exceptions, framing) #13

lanthaler opened this issue Aug 24, 2011 · 3 comments

Comments

@lanthaler
Copy link
Member

What should we do in API when things go wrong? Raise expections? Return null?

Consensus on the telecon was that we shoud raise exceptions in case of error and just return valid data.

What should we if your frame didn't match your input?

  • return null
  • return {}

Most people opted for returning {} at the telecon but there might be some implications that should be further investigated.

@lanthaler
Copy link
Member Author

See also follow up on the mailing list by Dave Longley: http://lists.w3.org/Archives/Public/public-linked-json/2011Aug/0078.html

@msporny
Copy link
Member

msporny commented Sep 11, 2011

The API was updated to throw exceptions when things go wrong. null is returned in the framing code when a frame has no match.

@msporny
Copy link
Member

msporny commented Jan 22, 2012

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

2 participants