class

Kemal::InvalidParameterError

Inherits Exception / Reference / Object

Exception raised when a parameter is present but its value cannot be converted to the declared type.

This error is raised when a controller method declares a typed parameter and the value exists in the request but fails type coercion (e.g. "foo" for an Int32, an unrecognised enum member, or an invalid boolean literal).

Example

@[Get("/users")]
def index(age : Int32)
  "Age: #{age}"
end
# GET /users?age=foo will raise Kemal::InvalidParameterError

Constructors

new(param_name : String, expected_type : String, value)
Source