Add `catch` function.

Closes #17.