credo-ts
credo-ts copied to clipboard
Error handling of received message
Currently, the AFJ agent receives messages in the background via receiveMessage. I'm curious how we should handle errors thrown by this method.
For example, when we're making a connection from AFJ to Trinsic, Trinsic sends JSON containing error without any @type attribute, therefore it fails because AFJ tries to decrypt it as an encrypted message. We can of course fix that by checking if JSON contains JWM attributes like protected. But then what we should do with such JSON error message or any other error that is thrown.
One solution which comes to my mind is having some message queue containing errors, ideally with some context to be able to react to that. Would that make sense?
Any other ideas?
Related to #1700