CNES / ccsdsmo-malgo

CCSDS MO MAL Go API
https://cnes.github.io/ccsdsmo-malgo
MIT License
10 stars 1 forks source link

Send error from provider to consumer #8

Closed etiennelndr closed 6 years ago

etiennelndr commented 6 years ago

For my ArchiveService I need to send errors from the provider to the consumer but I don't really how I can do this. I imagine that I have to use the type MessageError but I don't know how to encode and send this element. How can I do this ?

freyssin commented 6 years ago

MessageError is related to MAL ErrorListener, this mechanism is used to notify asynchronous errors that occur in the MAL. At the service level, error messages are normally described in the specification with the other messages of the interaction. The body of an error message must consist of an error number followed by extra information. Each service specification must define which error numbers may be returned for a given operation and the nature of the additional information (possibly missing). Depending on the operation being processed, you must encode the error message according to the information described in the specification. At the API level, you must use the transaction method that corresponds to your current interaction (acknowledgment, response, update, etc.) to send this message and specify that it is an error using the isError parameter.