Handle exceptions immediately instead of throwing them.

Signed-off-by: Henry Heikkinen <rce@rce.fi>