Wrap error message inside error object.

The app controller will handle the error object before passing it
to the middleware. It needs to set up the headers, etc. and other
layout. Thus, we need to let the controller know that there was
an error. We can do so by passing an 'error' object inside the config.