From 2c11c1d8484a5c71291b417e5e3dd51d6ce3b87d Mon Sep 17 00:00:00 2001 From: braveocheretovych Date: Mon, 20 Apr 2026 11:22:40 +0300 Subject: [PATCH 1/2] 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) } From 217276d67897a3e20aa34ea0bcc902408abc7e32 Mon Sep 17 00:00:00 2001 From: braveocheretovych Date: Thu, 21 May 2026 08:30:02 +0000 Subject: [PATCH 2/2] fix(store): use NewYAMLError when parsing twurlrc --- store/tokens.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/tokens.go b/store/tokens.go index 535f764..8c094c4 100644 --- a/store/tokens.go +++ b/store/tokens.go @@ -366,7 +366,7 @@ func (s *TokenStore) importFromTwurlrc(filePath string) error { } if err := yaml.Unmarshal(data, &twurlConfig); err != nil { - return errors.NewJSONError(err) + return errors.NewYAMLError(err) } app := s.activeAppOrCreate()