错误处理
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user