OpenAssetIO
OpenAssetIO copied to clipboard
`BatchElementError` type for callback-based batch methods
What
Add a BatchElementError class to be used in error callbacks for batch-first API methods.
Why
Our batch-first design means that errors that affect only a single element of the batch should not cause the whole batch to fail. Instead, such errors are communicated via an error callback, with a unique call per failed batch element.
We need some way for the manager to communicate the reason for a failure to the error callback. In order for this to be extensible we need to bundle the error details into a class. At minimum these details will include an error code and message, giving the same level of information as a standard exception.
ACs
- A header containing error codes in the core library that is importable in the C library, in order to prevent duplication of error codes.
- This should not have a dependency on the C library/headers.
- Initially supporting only "kUnknown".
- Do not overlap these new error codes with the exception error codes.
-
BatchElementErrorvalue semantic struct containing-
enum class ErrorCode(initially) supporting only "kUnknown". - Error code value,
const ErrorCode code. - Error message value
const std::string message.
-
- C API sketch
Out of scope
- New error codes.
Added C API issue with sketch in #570