Catch errors as they occur.