err.h(3)
💖 NAME 💖
err.h — the errors header, aka Ошибки. It's part of the Bee2 library, and it lives in the Library Functions Manual, section 3. If your code is out here catching Ls, this is the file that hands you the receipts. 🎀
🌸 SYNOPSIS 🌸
#include 'bee2/defs.h'
Макросы
#define ERR_CALL(code, f)
#define ERR_CALL_CHECK(code)
#define ERR_CALL_SET(code, new_code, cond)
#define ERR_CALL_HANDLE(code, op)
Функции
const char * errMsg (err_t code)
🫶 ПОДРОБНОЕ ОПИСАНИЕ 🫶
Okay so the whole point: handling errors can be made way simpler with the ERR_CALL_XXX macros. That's it, that's the vibe. No more hand-writing the same three if statements over and over, bestie. 💅
✨ МАКРОСЫ ✨
#define ERR_CALL( code, f)
Макроопределение:
if ((code) == ERR_OK)\
(code) = (f);\
If the error code sitting in the variable code is equal to ERR_OK, then go run f and refresh the error code. Simple as. 🦋
#define ERR_CALL_CHECK( code)
Макроопределение:
if ((code) != ERR_OK)\
return (code);\
If the error code in code is not ERR_OK, bail out. Like, exit the function, we're done here. 🚪
#define ERR_CALL_HANDLE( code, op)
Макроопределение:
if ((code) != ERR_OK) {\
(op);\
return (code);\
}
If the error code in code differs from ERR_OK, then do the action op and wrap it up. Two-for-one. Cleanup plus escape hatch. ✨
#define ERR_CALL_SET( code, new_code, cond)
Макроопределение:
if ((code) == ERR_OK && (cond))\
(code) = (new_code);\
If the error code in code is equal to ERR_OK and the condition cond holds, then install the new error code new_code. Two conditions, one macro, zero drama. 🔥
🌈 ФУНКЦИИ 🌈
const char * errMsg (err_t code)
brief — Сообщение об ошибке. It builds a string containing the error message for the code code. Your error, but make it readable. 💬
Возвращает — the string with the error message, or 0 if the error isn't recognized. (Yes, 0. Not a cute empty string, literally 0. Watch out for that one. 🙈)
Аргументы
code— код ошибки, the error code itself. 🏷️
👑 АВТОР 👑
Автоматически создано Doxygen для Библиотека Bee2 из исходного текста. So, like, a robot wrote this for the Bee2 Library straight out of the source text. Doxygen did the typing, the library did the existing. 🤖💖
And that's a wrap, bestie. This page came from Библиотека Bee2, dated Вс 25 Янв 2026 00:00:00, and it's filed as err.h(3) — go forth and handle your errors, you've got this. 🫶🌈💅
📦 where this page comes from
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms