  
          kwargs = {self.pk_url_kwarg: obj.pk, self.slug_url_kwarg: slug}
          try:
              return reverse(view_name, kwargs=kwargs, request=request, format=format)
          except:
              pass
  
          raise Exception('Could not resolve URL for field using view name "%s"' % view_name)
  
  
 
</s> remove         except:
 </s> add         except NoReverseMatch: </s> remove         except:
 </s> add         except NoReverseMatch: </s> remove         except:
 </s> add         except NoReverseMatch: </s> remove         except:
 </s> add         except NoReverseMatch: </s> remove         except:
 </s> add         except NoReverseMatch:
        except NoReverseMatch:
  
          kwargs = {self.pk_url_kwarg: obj.pk, self.slug_url_kwarg: slug}
          try:
              return reverse(view_name, kwargs=kwargs, request=request, format=format)
        except NoReverseMatch:
              pass
  
          raise Exception('Could not resolve URL for field using view name "%s"' % view_name)
  
  
keep keep keep keep replace keep keep keep keep keep
 Purge naked excepts.

Most of these had obvious exceptions which would be thrown. Some I'm not
sure about but they should at least catch only Exception so as not to
ignore SystemExit and other inappropriate Error classes. 
rest_framework/relations.py