class Kemal::KeyError

Overview

Exception raised when a required parameter is not found in the request.

This error is raised when a controller method declares a non-nilable parameter but the corresponding key is missing from the request data.

Example

@[Get("/users")]
def index(name : String) # name is required
  "Hello, #{name}"
end
# GET /users without ?name=... will raise Kemal::KeyError

Defined in:

kemal/from_www_form.cr

Constructors

Constructor Detail

def self.new(form_key : String) #

[View source]