Websocket client: propagate decoding errors to application
What
This change propagates decoding errors from the websocket client to the application layer.
Why
Previously, if the websocket client failed to decode a message, the error was not surfaced to the application, leading to silent failures and the client refusing to process new frames. This change ensures that the application is aware of these errors and can handle them appropriately.
How
The websocket client's decoding logic was modified to catch decoding exceptions. When an error is caught, it is now propagated up to the application callback, allowing the application to implement its own error-handling logic.
The FA bridge watchtower now crashes if for instance it cannot decode a notification:
Error:
Cannot destruct notification for subscription ["newHeads"] of id 0xf74c7d9bec5614641c4156ebfa1f7396: No case matched:
Missing object field totalDifficulty
Missing object field address
No case matched:
Unexpected object instead of string
Missing object field invalid_utf8_string
Missing object field syncing
Missing object field l1Level