I am packaging an app called Paperwork which has been created with the Laravel Framework for a platform called Sandstorm. I first have build the package with Docker and now switched to Vagrant for that. I have a problem migrating old instances of the package which have been created with Docker to the new version.
At one point an error from the Laravel Framework is shown which indicates an issue with the MySQL connection or the database elsewhere but instead of showing a helpful SQL error a "Class not found" error is shown.
Take an existing app with database and rename a random used table to something else.
The raised error should show a message like "table xyz not found" or something else helpful should be shown, like "advertised" in the code:
// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
The following message appears which doesn't help to track down the root cause:
/opt/app/frontend/vendor/laravel/framework/src/Illuminate/Database/Connection.php
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Class 'Illuminate\Database\QueryException' not found
}
// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
catch (\Exception $e)
{
throw new QueryException(
$query, $this->prepareBindings($bindings), $e
);
I guess that the class QueryException
is a component of the Laravel Framework which has been changed or doesn't work as expected.
Can you please help me with that? Am I guessing right or is the cause of the not so good fatal error exception not based in the Laravel Framework?
FYI: a screen shot of the error message:
Laravel 4.2 is not supported, sorry.
It would be nice to have at least a useful hint like "upgrade to the latest framework". A "We are not helping" response is pretty lame.
FYI, if anybody else has an older version of the framwork and gets an issue:
Add in paperwork/frontend/vendor/laravel/framework/src/Illuminate/Database/Connection.php
this line at the beginning:
use Illuminate\Database\QueryException;
After having done that you get a proper error message and can start debugging.
Most helpful comment
FYI, if anybody else has an older version of the framwork and gets an issue:
Add in
paperwork/frontend/vendor/laravel/framework/src/Illuminate/Database/Connection.php
this line at the beginning:After having done that you get a proper error message and can start debugging.