E_VALIDATION_FAILED: Validation failed


Just upgraded from 4.0 to 4.1

I have a simple route validator on POST. In validator file I have rules() messages()

'use strict'

class RegistrationValidation {

  get sanitizationRules () {
    return {
      email:  'normalize_email'

  get rules () {
    return {
      username: 'required|min:4|max:15',
      email: 		'required|email|max:50|unique:users:email',
      password: 'required|min:6',
      password_confirmation: 'required_if:password|same:password'

  get messages () {
    return {
      required: '{{ field }} is required to register!',
      min: 			'{{ field }} is too short!',
      max:			'{{ field }} is too long!',
      unique:		'{{ field }} is used!',
      same :    'Password must match!'

module.exports = RegistrationValidation

and route:

Route.post('register', 'AuthController.register').validator('RegistrationValidation')

Anyway, before the upgrade worked fine,. In the view I fetched the errors array with

  @each(error in old('errors'))
  <div class="alert alert-danger alert-dismissable">
    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
      {{ error.message }}

Now all I am getting is
E_VALIDATION_FAILED: Validation failed

What did I miss?



Can you share the global exception handler code



Hey @virk - I did check the upgrade docs again and indeed exception was missing the one pointed in the docs.

await super.handle(...arguments)

so now it is working again!

Thank you! :slight_smile: