Download src/error.hpp from chibifire/motion-bricks.cpp: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/chibifire/motion-bricks.cpp/resolve/main/src/error.hpp
- Command line
-
hf download hf://chibifire/motion-bricks.cpp/src/error.hpp
-
curl -L -o error.hpp https://huggingface.co/chibifire/motion-bricks.cpp/resolve/main/src/error.hpp
1.04 kB
| namespace motionbricks::detail { | |
| void write_error(char * output, std::uint64_t capacity, std::string_view message) noexcept; | |
| template <class Function> | |
| mb_status guard(char * error, std::uint64_t error_capacity, Function && function) noexcept { | |
| try { | |
| write_error(error, error_capacity, {}); | |
| return function(); | |
| } catch (const std::bad_alloc &) { | |
| write_error(error, error_capacity, "allocation failed"); | |
| return MB_OUT_OF_MEMORY; | |
| } catch (const std::exception & exception) { | |
| write_error(error, error_capacity, exception.what()); | |
| return MB_INTERNAL_ERROR; | |
| } catch (...) { | |
| write_error(error, error_capacity, "unknown internal error"); | |
| return MB_INTERNAL_ERROR; | |
| } | |
| } | |
| mb_status fail(mb_status status, char * error, std::uint64_t error_capacity, | |
| std::string_view message) noexcept; | |
| } // namespace motionbricks::detail | |