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

Connector object() throws an exception but json returns null|object? #418

Closed
Braunson opened this issue May 22, 2024 · 1 comment
Closed

Comments

@Braunson
Copy link
Contributor

Braunson commented May 22, 2024

When attempting to get the data from a connector's request, we can use ->json() which will return null if it fails/nothing is available. However if we use ->object() it will throw an exception on error.

Shouldn't the object() method also follow the same expectation as json()? I would expect a null/empty array response instead of an exception.

Secondly any reason we cannot provide a key/default in the object like we do with json() and array()?

If this is something that the maintainer feels is necessary. I can put in a PR for it.

@Braunson Braunson changed the title Connector object() throws an exception but json returns null|array? Connector object() throws an exception but json returns null|object? May 22, 2024
@Sammyjo20
Copy link
Member

Fixed in #420 thanks for the PR @Braunson !

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

No branches or pull requests

2 participants