Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
294 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import TaskError from "./task-error"; | ||
|
||
export default class RetriesExhaustedError extends TaskError { | ||
constructor(taskName: string, totalRetries: number, lastTrialError: Error) { | ||
super(taskName, `retries exhausted after ${totalRetries + 1} attempts`, { | ||
original: lastTrialError, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as FirebaseError from "../../error"; | ||
|
||
export default abstract class TaskError extends FirebaseError { | ||
constructor(taskName: string, message: string, options: object = {}) { | ||
super(`Task ${taskName} failed: ${message}`, options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import TaskError from "./task-error"; | ||
|
||
export default class TimeoutError extends TaskError { | ||
constructor(taskName: string, timeout: number) { | ||
super(taskName, `timed out after ${timeout}ms.`); | ||
} | ||
} |
Oops, something went wrong.