CliTaskResult
Abstract class representing the result of a task. Includes methods for handling success, exit codes, and chaining tasks.
Import:
import { CliTaskResult } from 'obsidian-dev-utils/script-utils/cli-utils';Signature:
export class CliTaskResultMethods
| Method | Returns | Description |
|---|---|---|
| exit() | void | Exits the process based on the task result. |
| isSuccessful() | boolean | Determines if the task was successful. |
| throwOnFailure() | void | Throws an error if the task was not successful. |
| static chain(tasks) | Promise<CliTaskResult> | Chains multiple tasks together, executing them sequentially until one fails. |
| static DoNotExit() | CliTaskResult | Creates a CliTaskResult that does not exit the process. |
| static Failure() | CliTaskResult | A failure result of a CLI task. |
| static FromExitCode(exitCode) | CliTaskResult | Creates a CliTaskResult based on an exit code. |
| static Success(isSuccess?) | CliTaskResult | Creates a CliTaskResult representing a successful task result. |
Links to this page: