scripting: Use logError to format error stack
Instead of manually formatting the error stack, use logError() to display the error. logError() displays the stack already. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
This commit is contained in:
parent
e4691d2717
commit
e3ea12b8d5
@ -295,14 +295,14 @@ async function _runPerfScript(scriptModule, outputFile) {
|
||||
try {
|
||||
await scriptModule.run();
|
||||
} catch (err) {
|
||||
log(`Script failed: ${err}\n${err.stack}`);
|
||||
logError(err, 'Script failed');
|
||||
Meta.exit(Meta.ExitCode.ERROR);
|
||||
}
|
||||
|
||||
try {
|
||||
_collect(scriptModule, outputFile);
|
||||
} catch (err) {
|
||||
log(`Script failed: ${err}\n${err.stack}`);
|
||||
logError(err, 'Script failed');
|
||||
Meta.exit(Meta.ExitCode.ERROR);
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ async function _runPerfScript(scriptModule, outputFile) {
|
||||
if (perfHelper._autoExit)
|
||||
perfHelper.ExitSync();
|
||||
} catch (err) {
|
||||
log(`Failed to exit helper: ${err}\n${err.stack}`);
|
||||
logError(err, 'Failed to exit helper');
|
||||
Meta.exit(Meta.ExitCode.ERROR);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user