Test catching exception.

See #232.