Add account usage logic (#1567)

---------

Co-authored-by: Yury Gargay <yury.gargay@gmail.com>
This commit is contained in:
Viktor Liu
2024-02-22 12:27:08 +01:00
committed by GitHub
parent e18bf565a2
commit b7a6cbfaa5
21 changed files with 576 additions and 30 deletions

View File

@ -1,6 +1,7 @@
package status
import (
"errors"
"fmt"
)
@ -68,7 +69,8 @@ func FromError(err error) (s *Error, ok bool) {
if err == nil {
return nil, true
}
if e, ok := err.(*Error); ok {
var e *Error
if errors.As(err, &e) {
return e, true
}
return nil, false