You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run php artisan scribe:generate -vvv (or php artisan scribe:generate --verbose)
I see some warnings for my models like "Couldn't get example model App\Model[modelname] via factoryCreate
I expected to see exception output (and stack trace) for each of these warnings, so I can debug the issue, but I only get the warning.
Explanation/analysis
The reason there is no exception output is that $completelySilent parameter for the function dumpExceptionIfVerbose is always set to true in the model factory exception handler:
I would expect that the parameter $completelySilent should either be absent or false in the code mentioned above. When I go to the vendor/ source and change that line to false, I get the stacktrace and exception output as expected.
I can submit a PR for this, if you agree with my analysis.
dlebech
changed the title
Exceptions during Model instantiation are never printed -- no matter verbose setting
Exceptions during Model creation for API endpoints are never printed -- no matter verbose setting
Sep 16, 2024
dlebech
changed the title
Exceptions during Model creation for API endpoints are never printed -- no matter verbose setting
Exceptions during Model factory creation for API endpoints are never printed -- no matter verbose setting
Sep 16, 2024
Yeah, I think the reason for that was to limit noise, since model instantiation was not very customizable in the past. But you're correct, this shouldn't swallow exceptions. PR welcome 👍
Scribe version
4.37.0
PHP version
8.2
Framework
Laravel
Framework version
11.12.0
Scribe config
What happened?
Reproduce
php artisan scribe:generate -vvv
(orphp artisan scribe:generate --verbose
)Explanation/analysis
The reason there is no exception output is that
$completelySilent
parameter for the functiondumpExceptionIfVerbose
is always set totrue
in the model factory exception handler:scribe/src/Extracting/InstantiatesExampleModels.php
Line 56 in 3ab4ae7
Possible fix
I would expect that the parameter
$completelySilent
should either be absent orfalse
in the code mentioned above. When I go to thevendor/
source and change that line tofalse
, I get the stacktrace and exception output as expected.I can submit a PR for this, if you agree with my analysis.
Docs
The text was updated successfully, but these errors were encountered: