-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherrors.go
More file actions
35 lines (27 loc) · 786 Bytes
/
Copy patherrors.go
File metadata and controls
35 lines (27 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package godicom
import "fmt"
// InvalidDICOMError is returned when data is not valid DICOM.
type InvalidDICOMError struct {
Message string
}
func (e *InvalidDICOMError) Error() string {
return fmt.Sprintf("godicom: invalid DICOM: %s", e.Message)
}
// BytesLengthError is returned when a value has an unexpected byte length.
type BytesLengthError struct {
Expected int
Actual int
VR VR
}
func (e *BytesLengthError) Error() string {
return fmt.Sprintf("godicom: expected %d bytes for VR %s, got %d", e.Expected, e.VR, e.Actual)
}
// TagError wraps an error with tag context.
type TagError struct {
Tag Tag
Err error
}
func (e *TagError) Error() string {
return fmt.Sprintf("godicom: tag %s: %v", e.Tag, e.Err)
}
func (e *TagError) Unwrap() error { return e.Err }