Closed Mondane closed 6 years ago
If you look at the config provider dependency aliases https://github.com/netglue/Expressive-Prismic/blob/master/src/ConfigProvider.php#L124 - Out of the box, the library replaces the default 404 and 500 error handlers - I use the "development mode" of Expressive to override this alias with something like
'factories' => [
'WhoopsError' => Container\WhoopsErrorResponseGeneratorFactory::class,
'Zend\Expressive\Whoops' => Container\WhoopsFactory::class,
'Zend\Expressive\WhoopsPageHandler' => Container\WhoopsPageHandlerFactory::class,
],
'aliases' => [
ErrorResponseGenerator::class => 'WhoopsError',
],
This way, I get detailed exception traces in Whoops by enabling development mode with composer development-enable
. I'm not likely to add any exception information in the shipped ErrorResponseGenerator because it could potentially leak your private access token to Prismic in production.
I'm trying to implement this package and got this error:
Might be a good idea to, at least in development mode, show the Exception in https://github.com/netglue/Expressive-Prismic/blob/master/src/Middleware/ErrorResponseGenerator.php#L46