laravel_exception 0.0.2-beta copy "laravel_exception: ^0.0.2-beta" to clipboard
laravel_exception: ^0.0.2-beta copied to clipboard

outdated

parse laravel exception message to dart class with geters to make it simpler

Laravel Exception #

Part of Queen Packages 👑 #

style: lint

Motivation #

  • since we work with APIs built with Laravel almost daily
  • i have built this package to easily wrap the validation exception which laravel might throw
  • you can easily know which fields got rejected or have failed and there messages

Content #

  • LaravelException Exception class which will parse the laravel response

example #

 // 422
if(res.statusCode == HttpStatus.unprocessableEntity){
      throw LaravelException.parse(res.data);
}

Exception props 🧬 #

  • keys contains the failed input keys in the exception object
  • errorMessages contains the failed input keys in the exception object
  • firstErrorMessage return the first failure message
  • toString() convert the object to one big error message

What is next ? #

  • dio interceptor
  • logs
9
likes
0
pub points
72%
popularity

Publisher

verified publishermaxzod.com

parse laravel exception message to dart class with geters to make it simpler

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

equatable, meta

More

Packages that depend on laravel_exception