Be more selective when catching exceptions