too many cases of 'except Exception'

Bug #1223605 reported by Joe Gordon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Unassigned

Bug Description

Ideally we should have very few cases of 'except Exception' a catch all exception like this can hide unrelated errors making debugging much harder.

Joe Gordon (jogo)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/45979

Changed in nova:
assignee: nobody → Joe Gordon (jogo)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/45982

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/45979
Committed: http://github.com/openstack/nova/commit/e1a54e58b507126c16c0793ba1743535ece8dd4d
Submitter: Jenkins
Branch: master

commit e1a54e58b507126c16c0793ba1743535ece8dd4d
Author: Joe Gordon <email address hidden>
Date: Tue Sep 10 16:51:13 2013 -0700

    Remove cases of 'except Exception' in tests.image

    except Exception can hide unrelated bugs, we shouldn't use it when
    possible.

    Change-Id: I5a8e3db8788e7a7b17b58a6c2c3999cf9a04e325
    Partial-Bug: #1223605

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/45982
Committed: http://github.com/openstack/nova/commit/3dc9cf175f466ce00bf7270cd1e51003802410c9
Submitter: Jenkins
Branch: master

commit 3dc9cf175f466ce00bf7270cd1e51003802410c9
Author: Joe Gordon <email address hidden>
Date: Tue Sep 10 17:08:36 2013 -0700

    Use test.TestingException where possible

    Instead of calling 'raise Exception()' in a stub, use
    tests.TestingException and only catch that exception. This will make
    sure the test have less false positives and hide other exceptions.

    Change-Id: I384c93e220d570abec25dcbacead0aa3bc33cbcf
    Partial-Bug: #1223605

Revision history for this message
Matt Riedemann (mriedem) wrote :

Any updates on this? It's pretty old and there are a few related fixes to unit tests, but not sure if there are bigger plans?

tags: added: testing
Changed in nova:
importance: Undecided → Low
Revision history for this message
Joe Gordon (jogo) wrote :

No updates on this at the moment, I moved it out of in progress and added the low hanging fruit tag.

tags: added: low-hanging-fruit
Changed in nova:
status: In Progress → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/136033

Changed in nova:
assignee: Joe Gordon (jogo) → Chris Gacsal (chris-gacsal)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/136033
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ea0451230e98cf0e640811407c4fd9a5224f0b97
Submitter: Jenkins
Branch: master

commit ea0451230e98cf0e640811407c4fd9a5224f0b97
Author: Krisztian Gacsal <email address hidden>
Date: Tue Nov 18 17:19:01 2014 +0100

    Remove except Exception cases

    Replaced 'except Exception' cases with the specific exceptions
    that the given code can throw in the util module. In some cases
    we added extra unit test to cover the specific exception.

    Change-Id: I980237ed9d27f122b4725b8c05015a81764dd6b8
    Partial-Bug: #1223605

Joe Gordon (jogo)
Changed in nova:
status: In Progress → Confirmed
assignee: Chris Gacsal (chris-gacsal) → nobody
Changed in nova:
assignee: nobody → Chris Gacsal (chris-gacsal)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Please switch this back to "In Progress" when there are active reviews's.

Changed in nova:
status: In Progress → Confirmed
Changed in nova:
assignee: Chris Gacsal (chris-gacsal) → ismdev (fernandez-molina-ismael)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/217067

Changed in nova:
assignee: ismdev (fernandez-molina-ismael) → Yixing (yixingj)
status: Confirmed → In Progress
Changed in nova:
assignee: Yixing (yixingj) → Rushi Agrawal (rushiagr)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/217067
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6b16177f907a5c41402e0a7617b500d98669b324
Submitter: Jenkins
Branch: master

commit 6b16177f907a5c41402e0a7617b500d98669b324
Author: Yixing Jia <email address hidden>
Date: Wed Aug 26 09:33:57 2015 +0000

    Replace except Exception with specific exception

    We should use specific exception instead of except
    Exception

    Co-Author: rushiagr (Rushi Agrawal)

    Partial-Bug: #1223605

    Change-Id: I95cb7ca0a7d920adbe65ba11493af6c5b32cd4d9

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/283506

Changed in nova:
assignee: Rushi Agrawal (rushiagr) → stgleb (gstepanov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Gleb Stepanov (<email address hidden>) on branch: master
Review: https://review.openstack.org/283506

stgleb (gstepanov)
Changed in nova:
assignee: stgleb (gstepanov) → nobody
Changed in nova:
status: In Progress → Confirmed
Revision history for this message
Sean Dague (sdague) wrote :

This is fine, we should do this. A general bug doesn't really solve it.

Changed in nova:
status: Confirmed → Opinion
importance: Low → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.