Ticket #1172 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Remove all try: except: blocks that don't re-raise the original exception

Reported by: thejimmyg Owned by: dread
Priority: major Milestone: ckan-sprint-2011-10-28
Component: ckan Keywords:
Cc: Repository: ckan
Theme: none


The current codebase has one or two try: except; blocks that don't catch specific exceptions. Under no circumstances should any broad try: except: blocks be allowed unless the exceptions they catch are immediately re-raised. Uncaught exceptions are wasting us quite a lot of time when trying to track down problems.

Change History

comment:1 Changed 3 years ago by thejimmyg

  • Milestone ckan-v1.5 deleted

comment:2 Changed 3 years ago by dread

  • Owner changed from thejimmyg to dread
  • Status changed from new to assigned

I've started this on branch defect-1172-exceptions

comment:3 Changed 3 years ago by dread

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Milestone set to ckan-current-sprint

Is in cset:47225f03e2af and merged to default for 1.4.4.

It now barfs instead of failing silently:

  • if the ckan config file has any errors
  • search indexing error

There are some other "except Exception" statements

comment:4 Changed 3 years ago by dread

I took out "raise" by mistake in ckan/lib/search/worker.py:26 but John has added it in in the corresponding place in ckan/lib/search/init.py on branch feature-1275-solr-search anyway.

Note: See TracTickets for help on using tickets.