make error message more clear when an argument can't be unmarshaled

This commit is contained in:
Dan Laine 2020-05-05 17:45:23 -04:00
parent c8a025e1d6
commit 940f9a2fb8
1 changed files with 7 additions and 0 deletions

View File

@ -50,3 +50,10 @@ func (r *request) Method() (string, error) {
uppercaseRune := string(unicode.ToUpper(firstRune))
return fmt.Sprintf("%s.%s%s", class, string(uppercaseRune), function[runeLen:]), nil
}
func (r *request) ReadRequest(args interface{}) error {
if err := r.CodecRequest.ReadRequest(args); err != nil {
return errors.New("couldn't unmarshal an argument. Ensure arguments are valid and properly formatted. See documentation for example calls")
}
return nil
}