Ok
but we want this type of error to be seen as invalid parameters instead of General error.
So you need to catch it and raise an InvalidParameters error.

Thanks

Max

On May 23, 2013, at 4:45 PM, Loïc <notifications@github.com> wrote:

> In lib/lims-core/actions/action.rb:
> 
> > +            if valid?
> > +              block.call(session)
> > +            else
> > +              invalid_parameters = {}.tap do |hash|
> > +                errors.keys.each do |key|
> > +                  hash[key] = [].tap do |array|
> > +                    # errors[key] returns an array of Aequitas::Violation
> > +                    errors[key].each do |error|
> > +                      array << error.message
> > +                    end
> > +                  end
> > +                end
> > +              end
> > +
> > +              raise InvalidParameters.new(invalid_parameters)
> > +            end
> >            end
> Yes, valid? raises an exception in the case we talked about yesterday with :required => true and :gte => 0. But actually, this exception is caught in lims-api/server.rb in the error block and produce a general_error.
> 
> —
> Reply to this email directly or view it on GitHub.
>