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

Error message gives internal location, not loc of the error #22

Open
jimav opened this issue Jan 11, 2024 · 0 comments
Open

Error message gives internal location, not loc of the error #22

jimav opened this issue Jan 11, 2024 · 0 comments

Comments

@jimav
Copy link

jimav commented Jan 11, 2024

If an unknown attribute is specified in a constructor call, the error looks like this:

Found unknown attribute(s) passed to the constructor: wrong at (eval 13) line 53.

Which is not very helpful because line 53 is somewhere in the internals, i.e. not the location of the erroneous call.
Errors from other places, such as a missing required attribute, give better message like

 Missing required arguments: x at main.pl line 13.

where "main.pl line 13" is the location of the erroneous call.

Can MooX::StrictConstructor be made to provide similar error messages, showing the location of the error?

The pod says a traceback isn't provided for security reasons and Your application can use Carp::Always to generate stack traces on "die". which is fine if someone really needs a full stack trace including sub arguments. Showing only the location of the error should not be a problem, particularly because other kinds of errors show it like the example given.

MooX::StrictConstructor version 0.011
Perl version 5.36.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant