Catch process exception
This commit is contained in:
parent
24ca757c92
commit
a119b36f72
|
@ -15,8 +15,10 @@
|
|||
|
||||
#include <glog/logging.h>
|
||||
|
||||
#include <exception>
|
||||
#include <utility>
|
||||
|
||||
#include "internal/strings.h"
|
||||
#include "internal/times.h"
|
||||
|
||||
MYNTEYE_BEGIN_NAMESPACE
|
||||
|
@ -192,6 +194,7 @@ void Processor::Run() {
|
|||
pre_callback_(input_.get());
|
||||
}
|
||||
bool ok = false;
|
||||
try {
|
||||
if (callback_) {
|
||||
if (callback_(input_.get(), output_.get(), parent_)) {
|
||||
ok = true;
|
||||
|
@ -201,6 +204,12 @@ void Processor::Run() {
|
|||
} else {
|
||||
ok = OnProcess(input_.get(), output_.get(), parent_);
|
||||
}
|
||||
// CV_Assert(false);
|
||||
} catch (const std::exception &e) {
|
||||
std::string msg(e.what());
|
||||
strings::rtrim(msg);
|
||||
LOG(ERROR) << Name() << " process error \"" << msg << "\"";
|
||||
}
|
||||
if (!ok) {
|
||||
VLOG(2) << Name() << " process failed";
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue
Block a user