Skip to content

Commit

Permalink
add comments to sentinel errors
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyshu committed Nov 23, 2023
1 parent 60ebdac commit ca1e8e5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ type Error string
// Error returns a string representation of the error
func (e Error) Error() string { return string(e) }

// CopyToNotPossible - CopyTo/MoveTo operations are only possible when seek position is 0,0
const CopyToNotPossible = Error("current cursor offset is not 0 as required for this operation")
const ErrNotExist = Error("file does not exist")
const ErrSeekInvalidOffset = Error("seek: invalid offset")
const ErrSeekInvalidWhence = Error("seek: invalid whence")
const (
// CopyToNotPossible - CopyTo/MoveTo operations are only possible when seek position is 0,0
CopyToNotPossible = Error("current cursor offset is not 0 as required for this operation")

// ErrNotExist - File does not exist
ErrNotExist = Error("file does not exist")

// ErrSeekInvalidOffset - Offset is invalid. Must be greater than or equal to 0
ErrSeekInvalidOffset = Error("seek: invalid offset")

// ErrSeekInvalidWhence - Whence is invalid. Must be one of the following: 0 (io.SeekStart), 1 (io.SeekCurrent), or 2 (io.SeekEnd)
ErrSeekInvalidWhence = Error("seek: invalid whence")
)

0 comments on commit ca1e8e5

Please sign in to comment.