laravel_exception 0.0.2-beta laravel_exception: ^0.0.2-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
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 objecterrorMessages
contains the failed input keys in the exception objectfirstErrorMessage
return the first failure messagetoString()
convert the object to one big error message
What is next ? #
- ❌ dio interceptor
- ❌ logs