laravel_exception 0.0.1-beta
laravel_exception: ^0.0.1-beta copied to clipboard
parse laravel exception message to dart class with geters to make it simpler
Laravel Exception #
Part of Queen Packages 👑 #
Motivation #
- since we work with APIs built with
Laravelalmost 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 #
LaravelExceptionException class which will parse the laravel response
example #
// 422
if(res.statusCode == HttpStatus.unprocessableEntity){
throw LaravelException.parse(res.data);
}
Exception props 🧬 #
keyscontains the failed input keys in the exception objecterrorMessagescontains the failed input keys in the exception objectfirstErrorMessagereturn the first failure messagetoString()convert the object to one big error message
What is next ? #
- ❌ dio interceptor
- ❌ logs