Skip to content

Commit 4b4ab67

Browse files
add isTerminatedError method
1 parent b56466d commit 4b4ab67

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/arguments.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ class Error {
160160
operator bool() const {
161161
return _message != OKAY_MESSAGE && _message != TERMINATED_MESSAGE;
162162
}
163+
164+
bool isTerminatedError() const {
165+
return _message == TERMINATED_MESSAGE;
166+
}
163167
};
164168

165169

src/profiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,14 +1920,14 @@ Error Profiler::runInternal(Arguments& args, Writer& out) {
19201920
break;
19211921
}
19221922

1923-
if (error.message() == TERMINATED_MESSAGE) {
1923+
if (error.isTerminatedError()) {
19241924
break;
19251925
}
19261926
// Fall through
19271927
}
19281928
case ACTION_DUMP: {
19291929
Error error = dump(out, args);
1930-
if (error.message() == TERMINATED_MESSAGE && args._action == ACTION_DUMP) {
1930+
if (error.isTerminatedError() && args._action == ACTION_DUMP) {
19311931
return Error("Unable to dump results after profiler termination");
19321932
}
19331933

0 commit comments

Comments
 (0)