Error / status codes #353
Replies: 5 comments 5 replies
-
Examples (note that naming is not final, just used for illustrative purposes.)
|
Beta Was this translation helpful? Give feedback.
-
Agree with @taprinz. The code should use simple status MACRO. |
Beta Was this translation helpful? Give feedback.
-
I agree with @taprinz with the origin status as well. I have been debugging issues and end up getting very generic error messages. These are in environments where there is no debugger and it is difficult to collect logs, so it's nice if more detailed error info is sent in the response. What I typically see is ErrorCode = some value and ErrorData = 0. There may be multiple places in a single response handler using the same ErrorCode. This occurs almost everywhere and makes it difficult to identify the specific "if" statement that is failing. It would be very helpful if every "if" statement that can fail, had a unique way to identify it, at least within a particular flow. For example, all Error Data values within the Get Measurements flow were distinct, but could overlap with those in a different flow such as Negotiate Algorithms. Also adding on to the MACRO usage. I would prefer if we had some macro for checking success and/failure so you could go: status = libspdm_get_measurements_hash(); } |
Beta Was this translation helpful? Give feedback.
-
Does RETURN_ERROR meet your requirement ? (https://github.com/DMTF/libspdm/blob/main/include/hal/base.h#L853) we need rename it to LIBSPDM_RETURN_ERROR. |
Beta Was this translation helpful? Give feedback.
-
Have we bottomed out on this? I can take a stab at implementing it to see how it goes. |
Beta Was this translation helpful? Give feedback.
-
This is a rough proposal for libspdm-specific error / status codes, so that we can discuss it at the 6-Dec-2021 meeting. The bits are in order of least-granularity to most-granularity, so a libspdm integrator is free to look at only the most-significant bit or all 32 bits (and every bit in between). Error Origin is a little iffy. Not sure if we need it, but it might have its uses.
In addition, extended error information can be stored in the libspdm context. For example if the Requester receives an ERROR response then the extended error information would contain the RequestResponseCode and ERROR response's code and data.
Beta Was this translation helpful? Give feedback.
All reactions