@@ -20,29 +20,16 @@ type wrappedCompilerError struct {
2020func (e * wrappedCompilerError ) Error () string { return e .formatted }
2121func (e * wrappedCompilerError ) Unwrap () error { return e .cause }
2222
23- // formatCompilerError creates a formatted compiler error message with optional error wrapping .
24- // It always uses line:1, column:1 so IDE tooling can navigate to the file even when a
25- // specific source position is unavailable .
23+ // formatCompilerError creates a formatted compiler error at line 1, column 1 .
24+ // Use this when the exact source position is unknown; IDE tooling can still navigate to the file.
25+ // Use formatCompilerErrorWithPosition when a specific line/column is available .
2626//
2727// filePath: the file path to include in the error (typically markdownPath or lockFile)
2828// errType: the error type ("error" or "warning")
2929// message: the error message text
3030// cause: optional underlying error to wrap (use nil for validation errors)
3131func formatCompilerError (filePath string , errType string , message string , cause error ) error {
32- compilerErrorLog .Printf ("Formatting compiler error: file=%s, type=%s, message=%s" , filePath , errType , message )
33- formattedErr := console .FormatError (console.CompilerError {
34- Position : console.ErrorPosition {
35- File : filePath ,
36- Line : 1 ,
37- Column : 1 ,
38- },
39- Type : errType ,
40- Message : message ,
41- })
42-
43- // Always return a *wrappedCompilerError so isFormattedCompilerError can detect it.
44- // cause may be nil for validation errors that have no underlying cause.
45- return & wrappedCompilerError {formatted : formattedErr , cause : cause }
32+ return formatCompilerErrorWithPosition (filePath , 1 , 1 , errType , message , cause )
4633}
4734
4835// isFormattedCompilerError reports whether err is already a console-formatted compiler error
0 commit comments