How can I catch exceptions?