错误处理

This commit is contained in:
2026-08-16 18:33:24 +08:00
parent 8612b5ff86
commit 389ff81d42
44 changed files with 536 additions and 261 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
#pragma once
#include <renderive/error/Error_Policy.hpp>
#include "Gallery_Actions.h"
#include "Gallery_Renderable_Types.h"
@@ -174,7 +175,7 @@ struct Value_Adapter<renderive::Color, Json> {
!std::all_of(value.begin() + 1, value.end(), [](unsigned char character) {
return std::isxdigit(character) != 0;
}))
throw std::invalid_argument("color must use #RRGGBB");
::renderive::error::unexpected<std::invalid_argument>("color must use #RRGGBB");
const auto channel = [&value](std::size_t offset) {
return static_cast<std::uint8_t>(std::stoul(value.substr(offset, 2), nullptr, 16));
};