Kemal::ParamError
Exception raised when a parameter is missing from the request, or is present but its value cannot be converted to the declared type.
Example
@[Get("/users")]
def index(name : String, age : Int32)
"Hello, #{name}, age #{age}"
end
# GET /users?age=30 (no name=...) raises Kemal::ParamError for "name",
# reason: Missing
# GET /users?name=Ary&age=foo raises Kemal::ParamError for "age",
# reason: CastError
Constructors
new(param_name : String, reason : Kemal::ParamError::Reason, expected_type : Nil | String = nil, value : Nil | String = nil)
SourceInstance methods
expected_type
The Crystal type name the parameter was declared as. nil when reason is Missing.