You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a NormalizerFormatter tries to normalize an object that implements '__toString' method, and this method throws an exception (which is exceptionally bad, but still), it results in a messy fatal error, which is hard to debug. This is especially painful if happens in the process of logging another error or exception, so we end up not knowing what the original error was.
The solution, i think, is to simply call '$data->__toString()' instead of '(string) $data', which will correctly throw an exception instead of triggering fatal error.
The text was updated successfully, but these errors were encountered:
When a NormalizerFormatter tries to normalize an object that implements '__toString' method, and this method throws an exception (which is exceptionally bad, but still), it results in a messy fatal error, which is hard to debug. This is especially painful if happens in the process of logging another error or exception, so we end up not knowing what the original error was.
The solution, i think, is to simply call '$data->__toString()' instead of '(string) $data', which will correctly throw an exception instead of triggering fatal error.
The text was updated successfully, but these errors were encountered: