While the error I have is also a question in itself, my particular current issue is that I can't even read half the error because it's truncated, so I have no clue what the error actually is.
terminal
$ vendor/bin/behat features/album.feature
Feature: Provide a consistent standard JSON API endpoint
In order to build interchangeable front ends
As a JSON API developer
I need to allow Create, Read, Update, and Delete functionality
Background: # features\album.feature:7
Given there are Albums with the following details: # FeatureContext::thereAreAlbumsWithTheFollowingDetails()
| title | track_count | release_date |
| The Dark side of the Moon | 12 | 1973-03-24T00:00:00+00:00 |
| Back in Black | 9 | 1980-06-25T23:22:21+00:00 |
| Thriller | 23 | 1982-11-30T11:10:09+00:00 |
Server error: `POST http://127.0.0.1:8000/api/album` resulted in a `500 Internal Server Error` response:
{
"code": 500,
"message": "Unexpected error occured: An exception occurred while executing 'INSERT INTO Album (t (truncated...)
(GuzzleHttp\Exception\ServerException)
The error is apparently given by my Exception Controller.
ExceptionController.php
...
/**
* @Rest\View()
* @param Request $request
* @param $exception
* @param DebuggerLoggerInterface|null $logger
* @return View
*/
public function show(Request $request, $exception, DebugLoggerInterface $logger = null){
if ($exception instanceof ValidationException) {
return $this->getView($exception->getStatusCode(), json_decode($exception->getMessage(), true));
}
if ($exception instanceof HttpException) {
return $this->getView($exception->getStatusCode(), $exception->getMessage());
}
return $this->getView(null, 'Unexpected error occured: '.$exception->getMessage());
}
...
How do I lose the truncation and see the full error?
Check the logs files:
var/log/dev.log
You could also do something like
tail -f var/log/dev.log
To see what follow what is getting written in your logs