vania-dart / framework

Fast, simple, and powerful backend framework for Dart built with ❤️
https://vdart.dev
MIT License
181 stars 15 forks source link

Hello, how do I add global exception handling #42

Closed Dartly closed 5 months ago

Dartly commented 5 months ago

For example, the parameter check does not pass, the return of the unified JSON.

javad-zobeidi commented 5 months ago

You can use

Response.json();

or

abort(400,'Error message');