class documentation
The error checking chain is a list of response apdu status word (sw1, sw2) error check strategies. Each strategy in the chain is called until an error is detected. A smartcard.sw.SWExceptions
exception is raised when an error is detected. No exception is raised if no error is detected.
Implementation derived from Bruce Eckel, Thinking in Python. The ErrorCheckingChain
implements the Chain Of Responsibility design pattern.
Method | __call__ |
Called to test data, sw1 and sw2 for error on the chain. |
Method | __init__ |
constructor. Appends a strategy to the ErrorCheckingChain chain. |
Method | add |
Add an exception filter to the error checking chain. |
Method | end |
Returns True if this is the end of the error checking strategy chain. |
Method | next |
Returns next error checking strategy. |
Instance Variable | chain |
Undocumented |
Instance Variable | excludes |
Undocumented |
Instance Variable | strategy |
Undocumented |
Add an exception filter to the error checking chain.
Parameters | |
ex | the exception to exclude, e.g. smartcard.sw.SWExceptions.WarningProcessingException A filtered exception will not be raised when the sw1,sw2 conditions that would raise the exception are met. |