task_error.ts

The errors a task throws to fail with a known failure, apart from the task runner (task.ts).

Making or matching one reaches nothing, so this module grants nothing: library code that fails a task, or classifies a failure, imports it without linking the task runner.

view source

Declarations
#

5 declarations

is_reported_error
#

task_error.ts view source

(error: unknown): error is ReportedError import {is_reported_error} from '@fuzdev/gro/task_error.js';

Whether error is a ReportedError or a subclass of one, from any copy of Gro.

error

type unknown

returns

boolean

is_task_error
#

task_error.ts view source

(error: unknown): error is TaskError import {is_task_error} from '@fuzdev/gro/task_error.js';

Whether error is a TaskError or a subclass of one, from any copy of Gro.

error

type unknown

returns

boolean

ReportedError
#

task_error.ts view source

import {ReportedError} from '@fuzdev/gro/task_error.js';

A failure its thrower has already reported, so Gro reports it no further and exits non-zero. Throw one after logging the failure; invoke_task throws one, with the failure as its cause, when the task it invoked fails.

inheritance

extends: Error

TaskError
#

task_error.ts view source

import {TaskError} from '@fuzdev/gro/task_error.js';

This is used by tasks to signal a known failure. It's useful for cleaning up logging because we usually don't need their stack trace.

inheritance

extends: Error

exit_code

The code the CLI exits with when this error fails the task it invoked, an integer 1–255; absent or any other value means 1.

type number | undefined

readonly

constructor

type new (message?: string | undefined, options?: TaskErrorOptions | undefined): TaskError

message?

type string
optional

options?

optional

TaskErrorOptions
#

task_error.ts view source

TaskErrorOptions import type {TaskErrorOptions} from '@fuzdev/gro/task_error.js';

Options for a TaskError.

inheritance

extends: ErrorOptions

exit_code?

The code the CLI exits with when this error fails the task it invoked, like gro run's script's own, an integer 1–255; absent or any other value means 1.

type number

Imported by
#