def __str__(self):
if self.value in CKR:<EOL><INDENT>if self.value < <NUM_LIT:0>:<EOL><INDENT>return CKR[self.value] + "<STR_LIT>" % self.text<EOL><DEDENT>else:<EOL><INDENT>return CKR[self.value] + "<STR_LIT>" % self.value<EOL><DEDENT><DEDENT>elif self.value & CKR_VENDOR_DEFINED:<EOL><INDENT>return "<STR_LIT>" % (self.value & <NUM_LIT> & ~CKR_VENDOR_DEFINED)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>" % self.value<EOL><DEDENT>
The text representation of a PKCS#11 error is something like:
"CKR_DEVICE_ERROR (0x00000030)"