mirror of
https://github.com/nabbar/golib.git
synced 2025-10-17 13:21:36 +08:00
Package AWS :
- Config Model : add a config model with a golib RouerStatus Config Model to use a AWS connection for API with a request status health check - Config Interface : add function GetAccessKey to retrieve the accesskey value currently used into the current connection - function Walk (Object, version, ...) : fix bug with pointer of string not initialized Package Config : - interface Component : add status router pointer into the Init function to allow used a global router status for all component status registration as router status component Package Status : - move Status Config as an sub package of Package Status Package Errors : - add CamelCase const Package Logger : - fix following bump dependencies Global : - bump dependencies - change init of errors files : change function never call vy panic to prevent an error code collision
This commit is contained in:
@@ -27,39 +27,37 @@
|
||||
|
||||
package progress
|
||||
|
||||
import liberr "github.com/nabbar/golib/errors"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
liberr "github.com/nabbar/golib/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
ErrorParamsEmpty liberr.CodeError = iota + liberr.MinPkgNutsDB
|
||||
ErrorParamsMissing
|
||||
ErrorParamsMismatching
|
||||
ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgNutsDB
|
||||
ErrorParamMissing
|
||||
ErrorParamMismatching
|
||||
ErrorBarNotInitialized
|
||||
)
|
||||
|
||||
var isCodeError = false
|
||||
|
||||
func IsCodeError() bool {
|
||||
return isCodeError
|
||||
}
|
||||
|
||||
func init() {
|
||||
isCodeError = liberr.ExistInMapMessage(ErrorParamsEmpty)
|
||||
liberr.RegisterIdFctMessage(ErrorParamsEmpty, getMessage)
|
||||
if liberr.ExistInMapMessage(ErrorParamEmpty) {
|
||||
panic(fmt.Errorf("error code collision with package golib/progress"))
|
||||
}
|
||||
liberr.RegisterIdFctMessage(ErrorParamEmpty, getMessage)
|
||||
}
|
||||
|
||||
func getMessage(code liberr.CodeError) (message string) {
|
||||
switch code {
|
||||
case liberr.UNK_ERROR:
|
||||
return ""
|
||||
case ErrorParamsEmpty:
|
||||
case ErrorParamEmpty:
|
||||
return "at least on given parameters is empty"
|
||||
case ErrorParamsMissing:
|
||||
case ErrorParamMissing:
|
||||
return "at least on given parameters is missing"
|
||||
case ErrorParamsMismatching:
|
||||
case ErrorParamMismatching:
|
||||
return "at least on given parameters is mismatching awaiting type"
|
||||
case ErrorBarNotInitialized:
|
||||
return "progress bar not initialized"
|
||||
}
|
||||
|
||||
return ""
|
||||
return liberr.NullMessage
|
||||
}
|
||||
|
Reference in New Issue
Block a user