From 2c11c1d8484a5c71291b417e5e3dd51d6ce3b87d Mon Sep 17 00:00:00 2001 From: braveocheretovych Date: Mon, 20 Apr 2026 11:22:40 +0300 Subject: [PATCH] feat(errors): add NewYAMLError and IsYAMLError functions Signed-off-by: braveocheretovych --- errors/errors.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/errors/errors.go b/errors/errors.go index f5767b3..e54a77c 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -14,6 +14,7 @@ const ( ErrTypeJSON = "JSON Error" ErrTypeAuth = "Auth Error" ErrTypeTokenStore = "Token Store Error" + ErrTypeYAML = "YAML Error" ) type Error struct { @@ -74,6 +75,10 @@ func NewJSONError(cause error) *Error { return NewError(ErrTypeJSON, cause.Error(), cause) } +func NewYAMLError(cause error) *Error { + return NewError(ErrTypeYAML, cause.Error(), cause) +} + func NewAuthError(message string, cause error) *Error { return NewError(ErrTypeAuth, message, cause) } @@ -95,3 +100,4 @@ func IsIOError(err error) bool { return IsErrorType(err, ErrTypeIO) } func IsAPIError(err error) bool { return IsErrorType(err, ErrTypeAPI) } func IsJSONError(err error) bool { return IsErrorType(err, ErrTypeJSON) } func IsAuthError(err error) bool { return IsErrorType(err, ErrTypeAuth) } +func IsYAMLError(err error) bool { return IsErrorType(err, ErrTypeYAML) }