go-rfc8259/errors/errors.go

24 lines
741 B
Go
Raw Normal View History

2023-11-05 07:23:40 +00:00
package rfc8259errors
import (
"sourcecode.social/reiver/go-erorr"
)
const (
ErrNilDestination = erorr.Error("rfc8259: nil destination")
ErrNilRuneScanner = erorr.Error("rfc8259: nil rune-scanner")
ErrUnexpectedEndOfFile = erorr.Error("rfc8259: unexpected end-of-file")
)
2023-11-06 12:26:38 +00:00
func ErrInternalError(msg string) error {
return erorr.Errorf("rfc8259: JSON parser had an unexpected internal-error — %s", msg)
}
2023-11-05 07:23:40 +00:00
func ErrProblemReadingRune(err error) error {
return erorr.Errorf("rfc8259: JSON parser had a problem — problem reading rune: %w", err)
}
func ErrProblemUnreadingRune(err error, r rune) error {
return erorr.Errorf("rfc8259: JSON parser had an internal-error — problem unreading rune %q (%U): %w", r, r, err)
}