refactor: rename package errors to zerrors (#7039)

* chore: rename package errors to zerrors

* rename package errors to gerrors

* fix error related linting issues

* fix zitadel error assertion

* fix gosimple linting issues

* fix deprecated linting issues

* resolve gci linting issues

* fix import structure

---------

Co-authored-by: Elio Bischof <[email protected]>
This commit is contained in:
Tim Möhlmann
2023-12-08 15:30:55 +01:00
committed by GitHub
co-authored by Elio Bischof
parent ddbea119f1
commit f680dd934d
798 changed files with 5809 additions and 5813 deletions
+5 -5
View File
@@ -6,7 +6,7 @@ import (
"github.com/zitadel/zitadel/internal/cache"
"github.com/zitadel/zitadel/internal/cache/bigcache"
"github.com/zitadel/zitadel/internal/cache/fastcache"
"github.com/zitadel/zitadel/internal/errors"
"github.com/zitadel/zitadel/internal/zerrors"
)
type CacheConfig struct {
@@ -26,7 +26,7 @@ func (c *CacheConfig) UnmarshalJSON(data []byte) error {
}
if err := json.Unmarshal(data, &rc); err != nil {
return errors.ThrowInternal(err, "CONFI-98ejs", "unable to unmarshal config")
return zerrors.ThrowInternal(err, "CONFI-98ejs", "unable to unmarshal config")
}
c.Type = rc.Type
@@ -34,7 +34,7 @@ func (c *CacheConfig) UnmarshalJSON(data []byte) error {
var err error
c.Config, err = newCacheConfig(c.Type, rc.Config)
if err != nil {
return errors.ThrowInternal(err, "CONFI-do9es", "unable create config")
return zerrors.ThrowInternal(err, "CONFI-do9es", "unable create config")
}
return nil
@@ -43,7 +43,7 @@ func (c *CacheConfig) UnmarshalJSON(data []byte) error {
func newCacheConfig(cacheType string, configData []byte) (cache.Config, error) {
t, ok := caches[cacheType]
if !ok {
return nil, errors.ThrowInternal(nil, "CONFI-di328s", "no config")
return nil, zerrors.ThrowInternal(nil, "CONFI-di328s", "no config")
}
cacheConfig := t()
@@ -52,7 +52,7 @@ func newCacheConfig(cacheType string, configData []byte) (cache.Config, error) {
}
if err := json.Unmarshal(configData, cacheConfig); err != nil {
return nil, errors.ThrowInternal(nil, "CONFI-skei3", "could not read config")
return nil, zerrors.ThrowInternal(nil, "CONFI-skei3", "could not read config")
}
return cacheConfig, nil