interface ErrorConstructor | globals module | Bun
BuildDocsReferenceGuidesBlogDiscord/
Globals/
ErrorConstructorMcaptureStackTraceCoconstructorMisErrorMprepareStackTracePprototypePstackTraceLimitSearch the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
Globals/
ErrorConstructorMcaptureStackTraceCoconstructorMisErrorMprepareStackTracePprototypePstackTraceLimitinterface
ErrorConstructorinterface
ErrorConstructorconstructor ErrorConstructor(message?: string):
Error;constructor ErrorConstructor(message?: string,options?:
ErrorOptions):
Error;readonly
prototype:
ErrorstackTraceLimit: number
The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
captureStackTrace(targetObject: object,constructorOpt?: Function): void;
Create .stack property on a target object
isError(value: unknown): value is
Error;
Check if a value is an instance of Error
@param value
The value to check
@returns
True if the value is an instance of Error, false otherwise
prepareStackTrace(err:
Error,stackTraces: CallSite[]): any;
Referenced typesinterface
Errorcause?: unknown
The cause of the error.
message: string
name: string
stack?: stringinterface
ErrorOptionscause?: unknown
The cause of the error.
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →