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

Type error: Return value of Kreait\Firebase\Exception\ApiException::getRequest() must implement interface Psr\Http\Message\RequestInterface, null returned #155

Closed
vokomarov opened this issue Jan 19, 2018 · 3 comments

Comments

@vokomarov
Copy link

vokomarov commented Jan 19, 2018

1. Which version of kreait/firebase-php are you using?

3.8.2

2. Which version of PHP are you using?

7.1.4

3. What's the issue?

Sometimes Firebase Realtime Database return 503 status code.

When i try to retrieve the request or response instance from Kreait\Firebase\Exception\ApiExceptioninstance on the catch block when this exception was throwed if request to Firebase Realtime Database returned with HTTP status 503 it throw a type error: Type error: Return value of Kreait\Firebase\Exception\ApiException::getRequest() must implement interface Psr\Http\Message\RequestInterface, null returned.

I cannot investigate why RDB return 503 sometimes because cannot get original request and response.

4. Code that lead to the issue

try {
    $db->getReference('/path')->getValue();
} catch (\Kreait\Firebase\Exception\ApiException $exception) {
    $exception->getRequest()->getBody()->getContents();
}
@jeromegamez
Copy link
Member

jeromegamez commented Jan 20, 2018

@VovikeMS Thank you for taking the time to report this issue! Please update to v3.9.2, this should solve it.

@vokomarov
Copy link
Author

@jeromegamez Thanks a lot for your great job 👍

@lock
Copy link

lock bot commented Mar 15, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants