spry_interceptor 1.0.0 copy "spry_interceptor: ^1.0.0" to clipboard
spry_interceptor: ^1.0.0 copied to clipboard

discontinuedreplaced by: spry

Exception interceptor for Spry, which intercepts exceptions and errors and writes response to prevent unexpected application interruption.

example/main.dart

import 'package:spry/spry.dart';
import 'package:spry_interceptor/spry_interceptor.dart';

void main() {
  final Spry spry = Spry();
  final Interceptor interceptor = Interceptor(
    handler: ExceptionHandler.json(),
  );

  handler(Context context) {
    throw HttpException.forbidden();
  }

  spry.use(interceptor);
  spry.listen(handler, port: 3000);

  print('Listening om http://localhost:3000');
}
0
likes
140
points
1
downloads

Publisher

verified publisherodroe.com

Weekly Downloads

Exception interceptor for Spry, which intercepts exceptions and errors and writes response to prevent unexpected application interruption.

Documentation

API reference

License

MIT (license)

Dependencies

spry, spry_json

More

Packages that depend on spry_interceptor