Rework Error interface

Package Errors:
- add function to check & cast error interface into golib Error interface
- update CodeError type to simplify management & error creation
- add function to simplify call of Error function from a generic error interface
- remove some useless function from Error interface

All Other Packages:
- apply change of package Errors into all other packages
This commit is contained in:
Nicolas JUHEL
2023-08-25 15:48:35 +02:00
parent a672f6ed10
commit 984ba51587
189 changed files with 1283 additions and 1435 deletions

View File

@@ -29,7 +29,6 @@ package database
import (
cfgtps "github.com/nabbar/golib/config/types"
libctx "github.com/nabbar/golib/context"
liberr "github.com/nabbar/golib/errors"
liblog "github.com/nabbar/golib/logger"
libver "github.com/nabbar/golib/version"
libvpr "github.com/nabbar/golib/viper"
@@ -103,11 +102,11 @@ func (o *componentDatabase) IsRunning() bool {
return true
}
func (o *componentDatabase) Start() liberr.Error {
func (o *componentDatabase) Start() error {
return o._run()
}
func (o *componentDatabase) Reload() liberr.Error {
func (o *componentDatabase) Reload() error {
return o._run()
}
@@ -145,7 +144,7 @@ func (o *componentDatabase) Dependencies() []string {
}
}
func (o *componentDatabase) SetDependencies(d []string) liberr.Error {
func (o *componentDatabase) SetDependencies(d []string) error {
o.m.RLock()
defer o.m.RUnlock()