Catch exceptions by const reference.

Change-Id: Ic537fd123478a4f8fe4e54736d444fa64fd62d9c
Reviewed-by: hjk <hjk121@nokiamail.com>