-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Debugging exceptions thrown in contexts #93
Comments
Exceptions aren't serializable, so we can't provide the original exception. You can use parallel/lib/Worker/TaskException.php Lines 42 to 45 in 71be8d1
|
I feel like you didn't even read my post to the end... The point is that trace just as string isn't very useful. And that exceptions mostly are serializable unless there is some unserializable argument somewhere in the stack trace which can be worked around. So we could provide the original (or close to original) exception with some work. |
Many things about the exception such as custom properties are still lost so I wouldn't call it ideal but okay. The main problem now though is Other than that I found one small thing while reviewing your code. See #97. |
Custom properties could be added by using reflection and flattening them in the worker, then adding a method to |
Which means I'd have to parse the exception message to get them - very bad DX.
Then what is the purpose of 0597620? |
The intention was for debugging during development where a person would be reading the message. The classes could be extended to make the message, etc. available, but what is your use case where logging the message from
So entire argument lists were readable in the stack trace. That was what I understood to be your original issue. Having it as a string was for BC, though again the classes could be extended to a make the argument list available as an array. |
Hey there, I'm coming from #76 (comment) but I thought this would be a better place to discuss. I was also wondering how to get data from the original exception, e.g. the exception contains a Any idea how we could achieve that in a clean way? Thanks! 😊 |
I'm trying out this package. At the moment my biggest issue with it is the (lack of) debugging support. When a task throws an exception, the original doesn't get it. Instead I only get an instance of
TaskException
which doesn't even have the message of the original exception, let alone it's type, stack trace and other properties (my custom exceptions often have additional properties for easier debugging).Ideally I'd like to get the original Exception instance, although I understand that in some cases it might not be serializable. Perhaps we could do some magic to ensure that it is serializable before sending it to the original process?
What are your thoughts on this? I could try to work on a pull request if such feature is desired. For instance something like this could be used as a fallback if plain serialization fails: https://gist.github.com/Thinkscape/805ba8b91cdce6bcaf7c
The text was updated successfully, but these errors were encountered: