Wrap cases where OperationFailure can occur.

This ensures we are returning JSON that the frontend error handler
expects.
Merge branch 'wrap-operation-failure' into playground