Skip to content

Commit 9992496

Browse files
committed
Ignore errors that are already raised
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
1 parent a6d93d5 commit 9992496

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/everest/framework/lib/error/error_manager_req.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ void ErrorManagerReq::on_error_raised(const Error& error) {
7474
EVLOG_error << ss.str();
7575
return;
7676
}
77+
std::list<ErrorPtr> errors =
78+
database->get_errors({ErrorFilter(TypeFilter(error.type)), ErrorFilter(SubTypeFilter(error.sub_type)),
79+
ErrorFilter(OriginFilter(error.origin))});
80+
if (!errors.empty()) {
81+
std::stringstream ss;
82+
ss << "Error of type '" << error.type << "' and sub type '" << error.sub_type
83+
<< "' is already raised, ignoring new error";
84+
ss << std::endl << "Error object: " << nlohmann::json(error).dump(2);
85+
EVLOG_error << ss.str();
86+
return;
87+
}
7788
database->add_error(std::make_shared<Error>(error));
7889
on_error(error, true);
7990
}

0 commit comments

Comments
 (0)