Catch exceptions by const reference.

Change-Id: Ib155b1b6f4e5d618d6e3143f43a2e7f9e7e1d410
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>