feat: enhanced error handling library

This commit is contained in:
yusing
2025-04-24 06:19:22 +08:00
parent ec8cca1245
commit 43566bbcfd
7 changed files with 176 additions and 47 deletions

View File

@@ -2,6 +2,7 @@ package gperr
import (
"encoding/json"
"errors"
"strings"
"github.com/yusing/go-proxy/internal/utils/strutils/ansi"
@@ -59,7 +60,7 @@ func (err *withSubject) Prepend(subject string) *withSubject {
}
func (err *withSubject) Is(other error) bool {
return err.Err == other
return errors.Is(other, err.Err)
}
func (err *withSubject) Unwrap() error {