From 4137d32f1c30ec65bec03191d1ab39679719533d Mon Sep 17 00:00:00 2001 From: hasezoey Date: Sat, 13 Jul 2024 14:06:17 +0200 Subject: [PATCH] style(errors): fix lint --- .../src/util/errors.ts | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/packages/mongodb-memory-server-core/src/util/errors.ts b/packages/mongodb-memory-server-core/src/util/errors.ts index 52f39d48..607f542d 100644 --- a/packages/mongodb-memory-server-core/src/util/errors.ts +++ b/packages/mongodb-memory-server-core/src/util/errors.ts @@ -1,10 +1,7 @@ import { isNullOrUndefined } from './utils'; export class StateError extends Error { - constructor( - public wantedStates: string[], - public gotState: string - ) { + constructor(public wantedStates: string[], public gotState: string) { super( `Incorrect State for operation: "${gotState}", allowed States: "[${wantedStates.join( ',' @@ -22,10 +19,7 @@ export class UnknownLockfileStatusError extends Error { } export class UnableToUnlockLockfileError extends Error { - constructor( - public thisInstance: boolean, - public file: string - ) { + constructor(public thisInstance: boolean, public file: string) { super( `Cannot unlock file "${file}", because it is not locked by this ${ thisInstance ? 'instance' : 'process' @@ -41,10 +35,7 @@ export class UnknownPlatformError extends Error { } export class UnknownArchitectureError extends Error { - constructor( - public arch: string, - public platform?: string - ) { + constructor(public arch: string, public platform?: string) { super(); if (!isNullOrUndefined(platform)) { @@ -56,10 +47,7 @@ export class UnknownArchitectureError extends Error { } export class WaitForPrimaryTimeoutError extends Error { - constructor( - public timeout: number, - public where?: string - ) { + constructor(public timeout: number, public where?: string) { super(`Timed out after ${timeout}ms while waiting for a Primary (where: "${where}")`); } } @@ -88,10 +76,7 @@ export class NoSystemBinaryFoundError extends Error { } export class Md5CheckFailedError extends Error { - constructor( - public binarymd5: string, - public checkfilemd5: string - ) { + constructor(public binarymd5: string, public checkfilemd5: string) { super(`MD5 check failed! Binary MD5 is "${binarymd5}", Checkfile MD5 is "${checkfilemd5}"`); } } @@ -154,10 +139,7 @@ export class ParseArchiveRegexError extends Error { } export class NoRegexMatchError extends Error { - constructor( - public name: string, - public extra?: string - ) { + constructor(public name: string, public extra?: string) { super(); const addExtra = !!extra ? `(${extra})` : ''; this.message = `Expected "${name}" to have Regex Matches${addExtra}`; @@ -222,10 +204,7 @@ export class UnknownVersionError extends Error { * Error for when downloading fails */ export class DownloadError extends Error { - constructor( - public url: string, - public msg: string - ) { + constructor(public url: string, public msg: string) { super(`Download failed for url \"${url}\", Details:\n${msg}`); } }