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

fix error reporting when loading applications with compile errors #2111

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

haarg
Copy link
Contributor

@haarg haarg commented Sep 19, 2023

When switching from loading an application from using require to using do, the error was still trying to be captured after a surrounding eval. This error would always be empty, because the error from the do was not rethrown. It would still result in an undef application, so an error would be thrown, but it would not include the actual compile error.

Change the do call inside the eval to throw an error if no application is returned. The error is then recaught outside the eval. Also add a test that shows that the real compilation error is included in the output.

Fixes #2110

When switching from loading an application from using require to using
do, the error was still trying to be captured after a surrounding eval.
This error would always be empty, because the error from the do was not
rethrown. It would still result in an undef application, so an error
would be thrown, but it would not include the actual compile error.

Change the do call inside the eval to throw an error if no application
is returned. The error is then recaught outside the eval. Also add a
test that shows that the real compilation error is included in the
output.

Fixes mojolicious#2110
@daleif
Copy link

daleif commented Sep 19, 2023

Works fine in my morbo non-lite test.

@mergify mergify bot merged commit 2c8d1b6 into mojolicious:main Sep 19, 2023
10 checks passed
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

Successfully merging this pull request may close these issues.

Morbo issues with Mojolicious 9.34 (change in Mojo/Server.pm)
4 participants