Make error router fall back to flask error handler

Fixes #296 and adds tests.