q/src/errors/New.go
Eduard Urbach ee1b7f4e44
Some checks failed
/ test (push) Failing after 17s
Added errors package
2025-06-19 16:56:30 +02:00

18 lines
No EOL
463 B
Go

package errors
import (
"git.urbach.dev/cli/q/src/fs"
"git.urbach.dev/cli/q/src/token"
)
// New generates an error message at the current token position.
// The error message is clickable in popular editors and leads you
// directly to the faulty file at the given line and position.
func New(err error, file *fs.File, position token.Position) *FileError {
return &FileError{
err: err,
file: file,
position: position,
stack: stack(),
}
}