Handle application errors in web actions. (#1801)

* Handle application error (handled exception).

If the activation result is an activation error, treat it like a successful
activation with one distinction: rather than projecting the result per the
path specified in the URL, project only the error field. The resulting JSON
value must be of the expected type otherwise, an appropriate error is reported.

This change will allow an HTTP response to set it own status code on error
for example, but also means that the action producing the error response must
be aware of the extension type.

The extension type is not passed to the action - perhaps it should be. Even so,
in the case of a sequence, one would need to forward this type to individual
components to handle the error case (or result) correctly.

Add tests for failure to activate because of the throttles.

* Tighten extension match, add matcher unit test.

* Consolidate extension maps.

* Remove print, fix typo.
2 files changed