Skip to content

Commit

Permalink
chore: Replace occurrences of the deprecated errorAndThrow API (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Dec 12, 2024
1 parent 692c475 commit 17aa093
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/tools/apk-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1195,10 +1195,10 @@ apkUtilsMethods.activateApp = async function activateApp (appId) {
output = await this.shell(cmd);
log.debug(`Command stdout: ${output}`);
} catch (e) {
log.errorAndThrow(`Cannot activate '${appId}'. Original error: ${e.message}`);
throw log.errorWithException(`Cannot activate '${appId}'. Original error: ${e.message}`);
}
if (output.includes('monkey aborted')) {
log.errorAndThrow(`Cannot activate '${appId}'. Are you sure it is installed?`);
throw log.errorWithException(`Cannot activate '${appId}'. Are you sure it is installed?`);
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/system-calls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,8 @@ systemCallMethods.reboot = async function reboot (retries = DEFAULT_ADB_REBOOT_R
if ((await this.getDeviceProperty('sys.boot_completed')) === '1') {
return;
}
// we don't want the stack trace, so no log.errorAndThrow
const msg = `Reboot is not completed after ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`;
// we don't want the stack trace
log.debug(msg);
throw new Error(msg);
});
Expand Down

0 comments on commit 17aa093

Please sign in to comment.