View Issue Details

IDProjectCategoryView StatusLast Update
0004407Talerobsolete componentpublic2016-04-24 21:45
ReporterFlorian Dold Assigned ToMarcello Stanisci Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version0.0 
Target Version0.0Fixed in Version0.0 
Summary0004407: bank throws exception classes instead of exception instances in some places
DescriptionThis is not how you're supposed to throw exception in Python.

Always throw instances: "raise BadWireDetails()" and not "raise BadWireDetails".

Also consider adding more information to the exceptions.

Additional Information    @staticmethod
    def validate_wiredetails(wiredetails, schema):
        try:
            validictory.validate(wiredetails, schema)
        except (ValueError, TypeError):
            raise BadWireDetails
        return True
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Florian Dold

2016-04-11 20:13

manager   ~0010457

Note that exception catching DOES NOT WORK otherwise.

Florian Dold

2016-04-14 17:38

manager   ~0010474

Also in some case we mix exception handling and return values in ... "unconventional" ways:

   @staticmethod
    def validate_amount(amount, schema):
        try:
            validictory.validate(amount, schema)
        except (ValueError, TypeError):
            raise BadAmount()
        return True

Note also that the "schema" parameter here is completely redundant.

Issue History

Date ModifiedUsernameFieldChange
2016-04-11 20:12Florian DoldNew Issue
2016-04-11 20:12Florian DoldStatusnew => assigned
2016-04-11 20:12Florian DoldAssigned To => Marcello Stanisci
2016-04-11 20:13Florian DoldNote Added: 0010457
2016-04-13 22:54Christian GrothoffSeverityminor => major
2016-04-13 22:54Christian GrothoffProduct Version => 0.0
2016-04-13 22:54Christian GrothoffTarget Version => 0.0
2016-04-14 17:38Florian DoldNote Added: 0010474
2016-04-18 08:00Marcello StanisciStatusassigned => informing
2016-04-18 08:00Marcello StanisciResolutionopen => fixed
2016-04-24 21:45Christian GrothoffStatusinforming => closed
2016-04-24 21:45Christian GrothoffFixed in Version => 0.0
2022-08-23 18:26Christian GrothoffCategorybank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 00:23Christian GrothoffCategorypy bank (demonstrator, obsolete) => obsolete componet
2023-12-11 19:08Florian DoldCategoryobsolete componet => obsolete component