Skip to content
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

[Feature request]: Make exception handling configurable #935

Open
1 task done
mortenscheel opened this issue Jan 10, 2025 · 1 comment
Open
1 task done

[Feature request]: Make exception handling configurable #935

mortenscheel opened this issue Jan 10, 2025 · 1 comment
Labels

Comments

@mortenscheel
Copy link
Contributor

Scribe version

4.38.0

Your question

Motivation

If a model generation strategy fails, a warning is printed in the console:

⚠ Couldn't get example model for App\Models\Whatever via factoryCreate.
  1. This message can be hard to spot, since scribe's output is quite verbose.
  2. The only way to discover why the generation failed, is by running scribe:generate with xdebug, while having a breakpoint at
    e::dumpExceptionIfVerbose($e, true);

Suggestions

  1. The message is printed with the same severity as something like No bodyParameters() method found.... I think it would be appropriate to print it in red.
  2. Add one or more configuration options for how these errors should be handled. Options could be something like:
    a. warn: (default, same as current behavior)
    b. dump: dump the exception to console, but continue execution
    c. fail: dump the exception to console, and abort with an exit code

Docs

@shalvah
Copy link
Contributor

shalvah commented Jan 18, 2025

Do you have an example of what Scribe's output looks like for you, so I can understand how verbose it is in context?

@shalvah shalvah removed the triage label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants