pyrad icon indicating copy to clipboard operation
pyrad copied to clipboard

Raises exception when attribute does not exist

Open marzsv opened this issue 6 years ago • 2 comments

Raises exception (instead of a general KeyError) when attribute does not exist in dictionaries, so the error can be handled easily by the consumer (server implementation).

marzsv avatar Aug 15 '18 15:08 marzsv

I think this shouldn't be an exception, but just fall into the default path of attribute handling. My approach to this is here: https://github.com/wichert/pyrad/pull/101

Basically my reasoning is, that you can probably never know all attributes you are going to handle. And also if someone sends an unknown attribute, it still doesn't mean that packet handling should fail. Most times with radius packets, there are plenty attributes sent along with no specific meaning or purpose to the task at hand, so ignoring them isn't an issue.

peterhoneder avatar Oct 26 '18 14:10 peterhoneder