isTriggerError jsdocs

This commit is contained in:
Matt Aitken
2023-07-04 16:28:58 +01:00
parent cca7da9da2
commit f160b34b34
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
isTriggerError jsdocs
+6
View File
@@ -12,6 +12,12 @@ export class RetryWithTaskError {
) {}
}
/** Use this function if you're using a `try/catch` block to catch errors.
* It checks if a thrown error is a special internal error that you should ignore.
* If this returns `true` then you must rethrow the error: `throw err;`
* @param err The error to check
* @returns `true` if the error is a Trigger Error, `false` otherwise.
*/
export function isTriggerError(
err: unknown
): err is ResumeWithTaskError | RetryWithTaskError {