View Issue Details

IDProjectCategoryView StatusLast Update
0005787Talerobsolete componentpublic2019-12-20 18:11
ReporterMarcello Stanisci 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
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.6Fixed in Version0.6 
Summary0005787: Make exception handling less confusing.
DescriptionException handling is ALL put into the middleware module, which makes hard to map exceptions to where those occur in the code. Also, the code errors are computed with a unnecessary/easy-to-break/cryptic arithmetic ([1]). Ultimately, new-comers who aren't aware of this module will naturally put their handlers NOT in that module, resulting in a mixed exception-handling style!

The suggestion is to place obvious exception handlers in the middleware module (malformed JSON / "bad requests" / ..), and spread other less obvious exceptions handlers to where in the code those could be raised.

[1] https://git.taler.net/bank.git/tree/talerbank/app/middleware.py#n149
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

related to 0005788 closedMarcello Stanisci Malformed JSON on POST makes bank crash. 

Activities

Marcello Stanisci

2019-09-21 17:22

reporter   ~0014928

4043cac..0025956 defines custom exception objects raised when a bank account or transaction aren't found in DB; this way we can get more information when such queries fail.

Marcello Stanisci

2019-09-25 09:45

reporter   ~0014956

Also to consider:

right now, the bank has multiple flavours for any type of error. For example,
it defines one error code for error X generated by endpoint Y, and defines *another*
error for (same) error X generated by endpoint Z.

Do we really need this level of precision? The requester should always know from
which endpoint it got the error.

Marcello Stanisci

2019-09-29 12:24

reporter   ~0014969

Readability improved due to removing unnecessary granularity of error codes (baee420..cba0af7).

Marcello Stanisci

2019-11-11 16:42

reporter   ~0015072

Not a bug anymore. Same style (*) used in Libeufin.

*: it means all the exceptions get managed in one place of the codebase (middleware.py).

Issue History

Date ModifiedUsernameFieldChange
2019-06-30 21:07Marcello StanisciNew Issue
2019-06-30 21:07Marcello StanisciStatusnew => assigned
2019-06-30 21:07Marcello StanisciAssigned To => Marcello Stanisci
2019-09-16 07:49Christian GrothoffRelationship addedrelated to 0005788
2019-09-16 07:50Christian GrothoffProduct Version => git (master)
2019-09-16 07:50Christian GrothoffTarget Version => 0.6
2019-09-21 17:22Marcello StanisciNote Added: 0014928
2019-09-25 09:45Marcello StanisciNote Added: 0014956
2019-09-29 12:24Marcello StanisciNote Added: 0014969
2019-11-11 16:42Marcello StanisciNote Added: 0015072
2019-11-11 16:42Marcello StanisciStatusassigned => informing
2019-11-11 16:42Marcello StanisciResolutionopen => fixed
2019-11-14 21:38Christian GrothoffFixed in Version => 0.6
2019-12-20 18:11Christian GrothoffStatusinforming => closed
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