fixes
This commit is contained in:
@@ -50,6 +50,9 @@ void raise_error(std::string_view function, std::int64_t err,
|
||||
void raise_error(std::string_view function, const std::exception &exception,
|
||||
std::string_view file_path, std::string_view msg);
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
std::string_view msg);
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
api_error err, std::string_view msg);
|
||||
|
||||
|
@@ -344,6 +344,8 @@ auto rdb_meta_db::remove_api_path(const std::string &api_path,
|
||||
|
||||
auto rdb_meta_db::remove_item_meta(const std::string &api_path,
|
||||
const std::string &key) -> api_error {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
||||
if (key == META_DIRECTORY || key == META_PINNED || key == META_SIZE ||
|
||||
key == META_SOURCE) {
|
||||
utils::error::raise_api_path_error(
|
||||
|
@@ -305,6 +305,8 @@ void sqlite_meta_db::remove_api_path(const std::string &api_path) {
|
||||
|
||||
auto sqlite_meta_db::remove_item_meta(const std::string &api_path,
|
||||
const std::string &key) -> api_error {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
||||
if (key == META_DIRECTORY || key == META_PINNED || key == META_SIZE ||
|
||||
key == META_SOURCE) {
|
||||
utils::error::raise_api_path_error(
|
||||
|
@@ -146,6 +146,13 @@ void raise_error(std::string_view function, const std::exception &exception,
|
||||
(exception.what() == nullptr ? "unknown error" : exception.what()));
|
||||
}
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
std::string_view msg) {
|
||||
event_system::instance().raise<repertory_exception>(
|
||||
function, static_cast<std::string>(msg) + "|ap|" +
|
||||
static_cast<std::string>(api_path));
|
||||
}
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
api_error err, std::string_view msg) {
|
||||
event_system::instance().raise<repertory_exception>(
|
||||
|
Reference in New Issue
Block a user