From 2c15d5cd4591d8c12eda6215524f2bd64b1735dc Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 16 Aug 2025 16:00:04 +0100 Subject: [PATCH] core: add new object related status codes --- core/error.c | 9 +++++++++ core/include/blue/core/status.h | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/core/error.c b/core/error.c index 12d6064..0ab3de1 100644 --- a/core/error.c +++ b/core/error.c @@ -694,6 +694,15 @@ static const struct b_error_definition builtin_errors[] = { B_ERR_PERMISSION_DENIED, "PERMISSION_DENIED", "Permission denied"), B_ERROR_DEFINITION(B_ERR_BUSY, "BUSY", "Resource busy or locked"), + B_ERROR_DEFINITION( + B_ERR_COMPRESSION_FAILURE, "COMPRESSION_FAILURE", + "Compression failure"), + B_ERROR_DEFINITION( + B_ERR_TYPE_REGISTRATION_FAILURE, "TYPE_REGISTRATION_FAILURE", + "Type registration failure"), + B_ERROR_DEFINITION( + B_ERR_CLASS_INIT_FAILURE, "CLASS_INIT_FAILURE", + "Class initialisation failure"), }; static const struct b_error_vendor builtin_vendor = { diff --git a/core/include/blue/core/status.h b/core/include/blue/core/status.h index dce1634..2629d2a 100644 --- a/core/include/blue/core/status.h +++ b/core/include/blue/core/status.h @@ -24,9 +24,23 @@ typedef enum b_status { B_ERR_NOT_DIRECTORY, B_ERR_PERMISSION_DENIED, B_ERR_BUSY, + + /* blue-compress specific code */ B_ERR_COMPRESSION_FAILURE, + + /* blue-object specific code */ + B_ERR_TYPE_REGISTRATION_FAILURE, + B_ERR_CLASS_INIT_FAILURE, } b_status; +typedef enum b_status_msg { + B_MSG_SUCCESS = 0, + + /* blue-object specific messages */ + B_MSG_TYPE_REGISTRATION_FAILURE, + B_MSG_CLASS_INIT_FAILURE, +} b_status_msg; + BLUE_API const char *b_status_to_string(b_status status); BLUE_API const char *b_status_description(b_status status);