Skip to main content

CompilerError

An error thrown by the compiler process. Can be a reference, syntax or type error.

export interface CompilerError {
  kind: CompilerErrorKind
  message: string
  name: "CompilerError"
  originalMessage: string
  otherErrors: undefined | CompilerError[]
  site: Site
}

Properties

kind

compilerError.kind satisfies CompilerErrorKind

message

Displayed message

compilerError.message satisfies string

name

compilerError.name satisfies "CompilerError"

originalMessage

Unformatted message

compilerError.originalMessage satisfies string

otherErrors

When an ErrorCollector has more than 1 error and ErrorCollector.throw is called, the first error is thrown and the remaining are attached to it.

compilerError.otherErrors satisfies undefined | CompilerError[]

site

Source code location of error

compilerError.site satisfies Site