Modules | @vltpkg/error-cause
Type Aliases
Codes
Valid properties for the ‘code’ field in an Error cause. Add new options to this list as needed.
Defined in
index.ts:182
DuckTypeManifest
Type declaration
arch?
deprecated?
dist?
dist.fileCount?
dist.integrity?
dist.shasum?
dist.signatures?
dist.tarball?
dist.unpackedSize?
engines?
name?
os?
version?
Defined in
index.ts:156
ErrorCause
Defined in
index.ts:176
ErrorCauseObject
Codification of vlt’s Error.cause conventions
Add new properties to this list as needed.
Several of these types are just very basic duck-typing, because referencing internal types directly would create a workspace dependency cycle.
Type declaration
args?
the arguments passed to a process
cause?
The cause
field within a cause
object should
always be an Error
object that was previously thrown. Note
that the cause
on an Error itself might also be a
previously thrown error, if no additional information could be
usefully added beyond improving the message.
code?
This should only be a string code that we set. See Codes for
the supported options. Lower-level system codes like ENOENT
should
remain on the errors that generated them.
command?
a command being run in a child process
cwd?
the current working directory of a process
found?
actual value, which was not wanted
from?
file path origin of a resolution that failed, for example in the case
of file://
specifiers.
manifest?
a package manifest, either from package.json
or a registry
max?
maximum value, which was exceeded
min?
minimum value, which was not met
name?
the name of something
offset?
byte offset in a Buffer or file
packument?
registry top-level package document
packument.dist-tags
packument.name
packument.time?
packument.versions
path?
target of a file system operation
projectRoot?
the root of a project
range?
string or @vltpkg/semver.Range
object
repository?
git repository remote or path
response?
HTTP message, fetch.Response, or @vltpkg/registry-client.CacheEntry
signal?
null or a signal that a process received
spec?
Spec object/string relevant to an operation that failed
status?
exit code of a process, or HTTP response status code
stderr?
standard error from a process
stdout?
standard output from a process
target?
path on disk that is being written, linked, or extracted to
todo?
message indicating what bit of work this might be a part of, what feature
needs to be implemented, etc. Eg, { todo: 'nested workspace support' }
.
url?
string or URL object
validOptions?
Array of valid options when something is not a valid option.
(For use in did you mean X?
output.)
version?
string or @vltpkg/semver.Version
object
wanted?
A desired value that was not found, or a regular expression or other pattern describing it.
Defined in
index.ts:11
Functions
error()
Parameters
• message: string
• cause?: ErrorCause
• from?: (…a
) => any
| (…a
) => any
Returns
Error
Defined in
index.ts:210
syntaxError()
Parameters
• message: string
• cause?: ErrorCause
• from?: (…a
) => any
| (…a
) => any
Returns
Error
Defined in
index.ts:222
typeError()
Parameters
• message: string
• cause?: ErrorCause
• from?: (…a
) => any
| (…a
) => any
Returns
Error
Defined in
index.ts:216