code: def _excepthook(self, etype, evalue, trace):
          
          if etype == ArgumentParserError:
              self.exit(code=CRITICAL,
                        message='error: {0}'.format(evalue),
                        extdata=self.parser.format_usage())
          else:
              self.exit(code=UNKNOWN,
                        message='Uncaught exception: {0} - {1}'
                                .format(etype.__name__, evalue),
                        extdata=''.join(traceback.format_tb(trace)))
docs: internal exception hook