Skip to content

Commit

Permalink
Throw an error in execute() instead of returning invalid value
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed May 11, 2024
1 parent 10b36cb commit 7a23987
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scriptable/scriptable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1946,8 +1946,9 @@ QJSValue Scriptable::execute()
connect( &action, &Action::actionOutput,
this, &Scriptable::onExecuteOutput );

if ( !runAction(&action) || action.actionFailed() )
return QJSValue();
if ( !runAction(&action) || action.actionFailed() ) {
return throwError( QStringLiteral("Failed to run command") );
}

if ( m_executeStdoutCallback.isCallable() ) {
const auto arg = toScriptValue(m_executeStdoutLastLine, m_engine);
Expand Down

0 comments on commit 7a23987

Please sign in to comment.