credo-ts icon indicating copy to clipboard operation
credo-ts copied to clipboard

Error handling of received message

Open jakubkoci opened this issue 3 years ago • 1 comments

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?

jakubkoci avatar Mar 10 '22 12:03 jakubkoci

Related to #1700

TimoGlastra avatar Feb 14 '24 06:02 TimoGlastra