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

DX: misleading error messages #1432

Open
staabm opened this issue Jul 10, 2024 · 0 comments
Open

DX: misleading error messages #1432

staabm opened this issue Jul 10, 2024 · 0 comments

Comments

@staabm
Copy link
Contributor

staabm commented Jul 10, 2024

using a invalid configuration like (note names: instead of value:)

  layers:
    - name: SuperGlobal
      collectors:
        - type: superglobal
          names:
            - _POST
            - _GET
            - _REQUEST

leads to a error like

$ composer deptrac
> vendor/bin/deptrac analyze --config-file=app/bridge/deptrac.yaml --report-uncovered --fail-on-uncovered
   1/272 [>---------------------------]   0%


 [ERROR] Analysis finished with an Exception.

         Invalid collector definition.

         SuperglobalCollector needs the names configuration.

the above config was valid in deptrac 1.x and I think the error message made sense at that time.
since deptrac 2.x requires a value: config attribute, I think the error message is no longer fitting:

SuperglobalCollector needs the names configuration.


I had a similar experience with

    - name: Controller
      collectors:
        - type: classLike
          regex: .*Controller.*(?<!ActionController)

which worked in deptrac 1.x but leads to this misleading error on deptrac 2.x:

$ composer deptrac
> vendor/bin/deptrac analyze --config-file=app/bridge/deptrac.yaml --report-uncovered --fail-on-uncovered



 [ERROR] Analysis finished with an Exception.

         Invalid collector definition.

         Collector "classLike" needs the regex configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants