Skip to content

Commit

Permalink
style(errors): fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Jul 13, 2024
1 parent 62f43e7 commit 4137d32
Showing 1 changed file with 7 additions and 28 deletions.
35 changes: 7 additions & 28 deletions packages/mongodb-memory-server-core/src/util/errors.ts
Original file line number Diff line number Diff line change
@@ -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(
','
Expand All @@ -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'
Expand All @@ -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)) {
Expand All @@ -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}")`);
}
}
Expand Down Expand Up @@ -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}"`);
}
}
Expand Down Expand Up @@ -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}`;
Expand Down Expand Up @@ -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}`);
}
}
Expand Down

0 comments on commit 4137d32

Please sign in to comment.