-
Notifications
You must be signed in to change notification settings - Fork 120
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
Error with CakePHP: Uncaught RuntimeException: You cannot call all() on a non-select query. Use execute() instead. #492
Comments
Workaround until this is fixed in Rollbar: public function handleException(Throwable $exception): void
{
$this->log($exception->getMessage(), LogLevel::ERROR);
if ($exception instanceof PDOException) {
// Custom handling due to https://github.com/rollbar/rollbar-php/issues/492
// Do not use `getTrace` as that will generate another Fatal like above
Rollbar::log(Level::ERROR, $exception->getMessage(), ['stacktrace' => $exception->getTraceAsString()], true);
} else {
Rollbar::log(Level::ERROR, $exception);
}
parent::handleException($exception);
} |
Another workaround (as a patch on if ($obj instanceof \Cake\ORM\Query) {
return self::serializeObject(
"Custom PDO error: " . $obj->sql(),
$customKeys,
$objectHashes,
$maxDepth,
$depth
);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using the latest rollbar version (2.0.0). Rollbar has started throwing this exception recently. I could not find the relevant method from the stack trace.
Looks like Rollbar is trying the serialize the Query object involved in the exception (to include in the payload) and fails.
The text was updated successfully, but these errors were encountered: