pysaml2 icon indicating copy to clipboard operation
pysaml2 copied to clipboard

Consider refactoring _parse_request

Open tpazderka opened this issue 8 years ago • 2 comments

Entity._parse_request can possibly raise a wide range of Exceptions (ValueError, TypeError, OSError, IncorrectlySigned, UnravelError) and return None on top of that.

None of the exceptions are caught and all propagate which is not a nice behaviour. It would probably make sense to catch these errors and rethrow a specific one so the catching is easier. Also the None return value is not documented. Relevant code

tpazderka avatar Sep 15 '17 09:09 tpazderka

I agree, it's difficult to handle correctly all errors, you need to override classes / methods. Maybe the method could return some data structure containing a list of errors and other info.

fmarco avatar Jul 27 '18 06:07 fmarco

@tpazderka probably we should start from a unit test that expose to us all the possible exception, it would be also a proof of a the inescapability of this necessary expedient.

+1

peppelinux avatar Sep 06 '20 00:09 peppelinux