In the case that send_message throws, the MirSurface constructor will now catch it and convert it in to an error. In this case the client library wont catch an exception and wont construct the duplicate error object.
The exception catch + error object creation is left in for cases where MirSurface constructor really does throw (e.g. as in the test which simulates BufferFactory throw failure).
It was necessary to make some changes in MirSurface::created to handle the pending call completion for the surface which never received a response.
I think this is the right fix now...(in r2133).
In the case that send_message throws, the MirSurface constructor will now catch it and convert it in to an error. In this case the client library wont catch an exception and wont construct the duplicate error object.
The exception catch + error object creation is left in for cases where MirSurface constructor really does throw (e.g. as in the test which simulates BufferFactory throw failure).
It was necessary to make some changes in MirSurface::created to handle the pending call completion for the surface which never received a response.