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

[11.x] Fix: Custom Exceptions with Multiple Arguments does not properly rein… #54705

Conversation

pandiselvamm
Copy link
Contributor

@pandiselvamm pandiselvamm commented Feb 19, 2025

This PR resolves this issue #54500

Problem:

In Concurrency Run When the custom exception is serialized and rethrown, Laravel only passes the message argument, missing other required parameters (custom parameters), causing an ArgumentCountError.


Fix Implementation:

  • Uses reflection to inspect the exception's constructor and extract required parameters.
  • Ensures correct reconstruction of the exception with all expected arguments.
  • Handles optional parameters and defaults gracefully.

Impact:

This fix ensures that exceptions with multiple arguments are correctly rethrown in the main process, preventing runtime errors and improving the reliability of concurrent tasks in Laravel.

@pandiselvamm pandiselvamm changed the title Fix: Custom Exceptions with Multiple Arguments does not properly rein… [11.x] Fix: Custom Exceptions with Multiple Arguments does not properly rein… Feb 19, 2025
@taylorotwell
Copy link
Member

Is it possible to write an integration test for this?

@taylorotwell taylorotwell marked this pull request as draft February 19, 2025 20:55
@pandiselvamm pandiselvamm marked this pull request as ready for review February 19, 2025 21:43
@pandiselvamm
Copy link
Contributor Author

Hi @taylorotwell , Integration tests were added kindly review it

thanks!

@pandiselvamm pandiselvamm marked this pull request as draft February 20, 2025 03:13
@pandiselvamm pandiselvamm marked this pull request as ready for review February 20, 2025 03:18
Pandi Selvam and others added 2 commits February 20, 2025 08:50
@taylorotwell taylorotwell merged commit c31126b into laravel:11.x Feb 20, 2025
44 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.

3 participants