summaryrefslogtreecommitdiffstats
path: root/common/herrors/file_error.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/herrors/file_error.go')
-rw-r--r--common/herrors/file_error.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/herrors/file_error.go b/common/herrors/file_error.go
index e6baaf6e3..9273b2a80 100644
--- a/common/herrors/file_error.go
+++ b/common/herrors/file_error.go
@@ -392,3 +392,17 @@ func extractPosition(e error) (pos text.Position) {
}
return
}
+
+// TextSegmentError is an error with a text segment attached.
+type TextSegmentError struct {
+ Segment string
+ Err error
+}
+
+func (e TextSegmentError) Unwrap() error {
+ return e.Err
+}
+
+func (e TextSegmentError) Error() string {
+ return e.Err.Error()
+}