sprintf and fix error codes
This commit is contained in:
parent
0be651fd27
commit
010386f48d
|
@ -1,15 +1,17 @@
|
|||
package cool
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
const (
|
||||
// Cool module reserves error 300-399 lawl
|
||||
CodeIncorrectCoolAnswer sdk.CodeType = 300
|
||||
// Cool module reserves error 400-499 lawl
|
||||
CodeIncorrectCoolAnswer sdk.CodeType = 400
|
||||
)
|
||||
|
||||
// ErrIncorrectCoolAnswer - Error returned upon an incorrect guess
|
||||
func ErrIncorrectCoolAnswer(answer string) sdk.Error {
|
||||
return sdk.NewError(CodeIncorrectCoolAnswer, "Incorrect cool answer")
|
||||
return sdk.NewError(CodeIncorrectCoolAnswer, fmt.Sprintf("Incorrect cool answer: %v", answer))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue