go-eol/errors.go

22 lines
605 B
Go
Raw Normal View History

2023-11-27 14:47:38 +00:00
package eol
import (
"sourcecode.social/reiver/go-erorr"
)
const (
errNilRuneScanner = erorr.Error("eol: nil rune-scanner")
)
func errNotEOL(r rune) error {
return erorr.Errorf("eol: %q (%U) is not an end-of-line character", r, r)
}
func errProblemReadingRune(err error, runeNumber uint64) error {
return erorr.Errorf("eol: problem reading rune №%d of end-of-line sequence: %w", runeNumber, err)
}
func errProblemUnreadingRune(err error, runeNumber uint64, r rune) error {
return erorr.Errorf("eol: problem unreading rune №%d (%q (%U)) of end-of-line sequence: %w", runeNumber, r, r, err)
}