Skip to content

Commit

Permalink
Revert unnecessary std::invalid_argument handling
Browse files Browse the repository at this point in the history
WE2-479

Signed-off-by: Mart Somermaa <[email protected]>
  • Loading branch information
mrts committed Sep 3, 2024
1 parent 8a33114 commit 847ba67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
13 changes: 0 additions & 13 deletions src/controller/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,6 @@ void Controller::run()

startCommandExecution();

} catch (const std::invalid_argument& exc) {
if (isInStdinMode) {
// Pass invalid argument message to the caller just in case it may be interested
// The result will be {"invalid-argument" : message}
// Command parameter is only used if exception will be raised during json creation
writeResponseToStdOut(isInStdinMode, {{QStringLiteral("invalid-argument"), exc.what()}},
"invalid-argument");
// Exit directly here
disposeUI();
exit();
return;
}
onCriticalFailure(exc.what());
} catch (const std::exception& error) {
onCriticalFailure(error.what());
}
Expand Down
6 changes: 3 additions & 3 deletions src/ui/webeiddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ QString WebEidDialog::getPin()
// QString uses QAtomicPointer internally and is thread-safe.
// There should be only single reference and this is transferred to the caller for safety
QString ret = pin;
// Cannot use eraseData because we have to force Qt copy-on-write
pin.fill('\0');
pin.clear();
// Cannot use eraseData because we have to force Qt copy-on-write
pin.fill('\0');
pin.clear();
return ret;
}

Expand Down

0 comments on commit 847ba67

Please sign in to comment.