This commit is contained in:
parent
1405d2b8b1
commit
ee1b7f4e44
4 changed files with 165 additions and 0 deletions
18
src/errors/New.go
Normal file
18
src/errors/New.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
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(),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue