Refactoring: Simplify retrieving error message

This commit is contained in:
Henry Mercer
2024-09-16 22:38:35 +02:00
parent bbd7c801a0
commit dd7307d603
54 changed files with 106 additions and 89 deletions

View File

@@ -177,17 +177,15 @@ export function cleanupDatabaseClusterDirectory(
if (isSelfHostedRunner()) {
throw new util.ConfigurationError(
`${blurb} This can happen if another process is using the directory or the directory is owned by a different user. ` +
`Please clean up the directory manually and rerun the job. Details: ${
util.wrapError(e).message
}`,
`Please clean up the directory manually and rerun the job. Details: ${util.getErrorMessage(
e,
)}`,
);
} else {
throw new Error(
`${blurb} This shouldn't typically happen on hosted runners. ` +
"If you are using an advanced setup, please check your workflow, otherwise we " +
`recommend rerunning the job. Details: ${
util.wrapError(e).message
}`,
`recommend rerunning the job. Details: ${util.getErrorMessage(e)}`,
);
}
}