Skip to content

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
@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

4 participants