Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

redstone-dart/redstone-exception-mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redstone exception mapper plugin

Usage

  • Add redstone_exception_mapper to your pubspec.yaml.
  • Import the plugin import 'package:redstone_exception_mapper/redstone_exception_mapper.dart' as plugin;
  • Add this line before the setup() call of Redstone : app.addPlugin(plugin.ExceptionMapperPlugin);
  • (Optional) You may turn off Redstone's error pages : app.showErrorPage = false;
  • Map your exceptions to a function returning a new shelf Response.
  plugin.mappings = {
    NotFoundException: (NotFoundException e) => new Response.notFound(e.message)
  };

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages