Add preparation for provider (bug 942361)

should be ``return app.error...`` right?