Open louischan-oursky opened 5 months ago
@louischan can you provide more context to help me evaluate the priority of this issue? Like how are the users (or who) affected, severity, and how complicated to fix?
Mainly, we (the developer of Authgear) will be affected. The problems will cause us to introduce bugs, like in this example I mentioned. It takes about 5 points to fix.
Problem 1: The presence of skyerr and APIError
Remove skyerr and use APIError
Problem 2: APIError is not errors friendly
For example, APIError does not Unwrap, nor it supports errors.Is. This causes us to use custom functions like apierrors.IsKind or IsRateLimitErrorWithBucketName to compare error. Example of bugs: https://github.com/authgear/authgear-server/commit/6b660e8eb60572ddc5b1d089a912be051dc15823
Problem 3: some features in errorutil duplicate with errors
For example, errorutil.Unwrap, which can be replaced by errors.Is and errors.As. errorutil.WithSecondaryError, which can be replaced by errors.Join.