refactor: Remove eslint-disable when possible

This commit is contained in:
Joachim Van Herwegen
2024-03-14 11:29:17 +01:00
parent 65bf2bd34e
commit fa060b86f3
12 changed files with 35 additions and 38 deletions

View File

@@ -61,10 +61,9 @@ export class HandlerServerConfigurator extends ServerConfigurator {
*/
private createErrorMessage(error: unknown): string {
if (!isError(error)) {
// eslint-disable-next-line ts/restrict-template-expressions
return `Unknown error: ${error}.\n`;
return `Unknown error: ${error as string}.\n`;
}
if (this.showStackTrace && error.stack) {
if (this.showStackTrace && isError(error) && error.stack) {
return `${error.stack}\n`;
}
return `${error.name}: ${error.message}\n`;