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

Function formatCompilerErrorWithPosition

pkg/workflow/compiler_error_formatter.go:74–89  ·  view source on GitHub ↗

formatCompilerErrorWithPosition creates a formatted compiler error with specific line/column position. filePath: the file path to include in the error line: the line number where the error occurred column: the column number where the error occurred errType: the error type ("error" or "warning") mes

(filePath string, line int, column int, errType string, message string, cause error)

Source from the content-addressed store, hash-verified

72// message: the error message text
73// cause: optional underlying error to wrap (use nil for validation errors)
74func formatCompilerErrorWithPosition(filePath string, line int, column int, errType string, message string, cause error) error {
75 compilerErrorLog.Printf("Formatting compiler error: file=%s, line=%d, column=%d, type=%s, message=%s", filePath, line, column, errType, message)
76 formattedErr := console.FormatError(console.CompilerError{
77 Position: console.ErrorPosition{
78 File: filePath,
79 Line: line,
80 Column: column,
81 },
82 Type: errType,
83 Message: message,
84 })
85
86 // Always return a *wrappedCompilerError so isFormattedCompilerError can detect it.
87 // cause may be nil for validation errors that have no underlying cause.
88 return &wrappedCompilerError{formatted: formattedErr, cause: cause}
89}
90
91// formatCompilerErrorWithContext creates a formatted compiler error with specific
92// line/column position and source-code context lines for Rust-style rendering.

Callers 4

formatCompilerErrorFunction · 0.85
FormatSecurityFindingsFunction · 0.85

Calls 2

FormatErrorFunction · 0.92
PrintfMethod · 0.45

Tested by 1