Skip to content
Snippets Groups Projects
Commit a0f6d763 authored by florian's avatar florian
Browse files

ENH: Add status code for errors in higher order clients

parent d15ab325
No related branches found
No related tags found
2 merge requests!12F consolidation,!8ENH: Add retrieval and queries to Extern C interface
Pipeline #11985 failed
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
...@@ -53,6 +53,7 @@ enum StatusCode { ...@@ -53,6 +53,7 @@ enum StatusCode {
UNSUPPORTED_FEATURE = 27, UNSUPPORTED_FEATURE = 27,
ORIGINAL_ENTITY_MISSING_ID = 28, ORIGINAL_ENTITY_MISSING_ID = 28,
EXTERN_C_ASSIGNMENT_ERROR = 29, EXTERN_C_ASSIGNMENT_ERROR = 29,
OTHER_CLIENT_ERROR = 9999;
}; };
auto get_status_description(int code) -> const std::string &; auto get_status_description(int code) -> const std::string &;
......
...@@ -83,7 +83,11 @@ auto get_status_description(int code) -> const std::string & { ...@@ -83,7 +83,11 @@ auto get_status_description(int code) -> const std::string & {
"This feature is not available in the this client implementation."}, "This feature is not available in the this client implementation."},
{StatusCode::EXTERN_C_ASSIGNMENT_ERROR, {StatusCode::EXTERN_C_ASSIGNMENT_ERROR,
"You tried to assign a new object to the wrapped void pointer. You have " "You tried to assign a new object to the wrapped void pointer. You have "
"to delete the old pointee first."}}; "to delete the old pointee first."},
{StatusCode::OTHER_CLIENT_ERROR,
"This is code is reserved to errors raised by other clients wrapping the "
"C++ client (or its Extern C interface). This should never occur when "
"working with the C++ code itself."}};
try { try {
return descriptions.at(code); return descriptions.at(code);
} catch (const std::out_of_range &exc) { } catch (const std::out_of_range &exc) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment