app: pre-declare errors
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
38f72825e0
commit
9fd55dbc0b
@ -2,7 +2,6 @@ package app
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"errors"
|
||||
|
||||
"git.dotya.ml/mirre-mt/pcmt/app/settings"
|
||||
"git.dotya.ml/mirre-mt/pcmt/ent"
|
||||
@ -68,7 +67,7 @@ func (a *App) Init(s *settings.Settings, logger *slogging.Logger, dbclient *ent.
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.New("ErrAppAlreadyInitialised")
|
||||
return ErrAppAlreadyInitialised
|
||||
}
|
||||
|
||||
// E returns app's *echo.Echo instance.
|
||||
@ -95,7 +94,7 @@ func (a *App) PrintConfiguration() {
|
||||
return
|
||||
}
|
||||
|
||||
panic(errors.New("somehow we got here with config unset - contact the developer"))
|
||||
panic(ErrAppSettingsUnset)
|
||||
}
|
||||
|
||||
func (a *App) SetSettings(s *settings.Settings) {
|
||||
|
8
app/error.go
Normal file
8
app/error.go
Normal file
@ -0,0 +1,8 @@
|
||||
package app
|
||||
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
ErrAppSettingsUnset = errors.New("somehow we got here with settings unset - contact the developer")
|
||||
ErrAppAlreadyInitialised = errors.New("app was already initialised")
|
||||
)
|
Loading…
Reference in New Issue
Block a user