Make Flask error handlers support injection