Skip to content

Cryptic error messages when filters param is not a key-value store #64

@bunnrf

Description

@bunnrf

With an empty filters param, Sift encounters:

"undefined method `[]' for nil:NilClass (NoMethodError
filter_params[filter.validation_field] && filter.custom_validate"

And trace points to:
lib/sift/filter_validator.rb:33 in `has_custom_validation?'

Similar errors when filters is something else.

Example query strings:
?filters
?filters=5

I expected an error message similar to the validation error messages Sift returns normally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions