View Issue Details

IDProjectCategoryView StatusLast Update
0004407Talerobsolete componentpublic2016-04-24 23:45
ReporterFlorian Dold Assigned ToMarcello Stanisci  
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.

Activities

Florian Dold

2016-04-11 22:13

manager   ~0010457

Note that exception catching DOES NOT WORK otherwise.

Florian Dold

2016-04-14 19: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 Modified Username Field Change
2016-04-11 22:12 Florian Dold New Issue
2016-04-11 22:12 Florian Dold Status new => assigned
2016-04-11 22:12 Florian Dold Assigned To => Marcello Stanisci
2016-04-11 22:13 Florian Dold Note Added: 0010457
2016-04-14 00:54 Christian Grothoff Severity minor => major
2016-04-14 00:54 Christian Grothoff Product Version => 0.0
2016-04-14 00:54 Christian Grothoff Target Version => 0.0
2016-04-14 19:38 Florian Dold Note Added: 0010474
2016-04-18 10:00 Marcello Stanisci Status assigned => resolved
2016-04-18 10:00 Marcello Stanisci Resolution open => fixed
2016-04-24 23:45 Christian Grothoff Status resolved => closed
2016-04-24 23:45 Christian Grothoff Fixed in Version => 0.0
2022-08-23 20:26 Christian Grothoff Category bank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 01:23 Christian Grothoff Category py bank (demonstrator, obsolete) => obsolete componet
2023-12-11 20:08 Florian Dold Category obsolete componet => obsolete component