MCPcopy Create free account
hub / github.com/github/gh-aw / isFormattedCompilerError

Function isFormattedCompilerError

pkg/workflow/compiler_error_formatter.go:55–64  ·  view source on GitHub ↗

isFormattedCompilerError reports whether err is already a console-formatted compiler error produced by formatCompilerError, formatCompilerErrorWithPosition, or parser.FormatImportError. Use this instead of fragile string-contains checks to avoid double-wrapping.

(err error)

Source from the content-addressed store, hash-verified

53// produced by formatCompilerError, formatCompilerErrorWithPosition, or parser.FormatImportError.
54// Use this instead of fragile string-contains checks to avoid double-wrapping.
55func isFormattedCompilerError(err error) bool {
56 var wce *wrappedCompilerError
57 if errors.As(err, &wce) {
58 return true
59 }
60 // Also detect errors from the parser package (e.g. FormatImportError) which are already
61 // console-formatted with source location and must not be re-wrapped.
62 var fpe *parser.FormattedParserError
63 return errors.As(err, &fpe)
64}
65
66// formatCompilerErrorWithPosition creates a formatted compiler error with specific line/column position.
67//

Callers 5

CompileWorkflowMethod · 0.85
CompileWorkflowDataMethod · 0.85

Calls

no outgoing calls

Tested by 1