vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • error
    • index
    • Reference
  • Type Aliases
  • ErrorCause
  • ParsedError
  • Functions
  • asRootError()
  • findRootError()
  • parseError()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/output
  6. /
  7. error

error

Type Aliases

ErrorCause

TypeScript
type ErrorCause = Record<string, unknown> & object;

Defined in: error.ts:3

Type declaration

NameType
cause?ErrorCause

ParsedError

TypeScript
type ParsedError = object;

Defined in: error.ts:7

Type declaration

Index Signature

TypeScript
[key: string]: unknown
NameType
cause?| ErrorCause | ParsedError
messagestring
namestring
stack?string

Functions

asRootError()

TypeScript
function asRootError(v, match?): Omit<ParsedError, "cause"> & Required<Pick<ParsedError, "cause">>

Defined in: error.ts:59

Find the root error from an unknown value and throw if one is not found.

Parameters

ParameterType
vunknown
match?{ code: string; }
match.code?string

Returns

Omit<ParsedError, "cause"> & Required<Pick<ParsedError, "cause">>


findRootError()

TypeScript
function findRootError(v, match?): null | ParsedError

Defined in: error.ts:46

Find the root error from an unknown value, optionally matching a code.

Parameters

ParameterType
vunknown
match?{ code: string; }
match.code?string

Returns

null | ParsedError


parseError()

TypeScript
function parseError(err): null | ParsedError

Defined in: error.ts:19

Parse an unknown value into an error. Will also take enumerable properties from legacy style Node errors and treat them as the cause.

Parameters

ParameterType
errunknown

Returns

null | ParsedError


Previous@vltpkg/outputNextindex

On this page

  • Type Aliases
  • ErrorCause
  • ParsedError
  • Functions
  • asRootError()
  • findRootError()
  • parseError()

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now