From f08f744cc2f0cb60574707326535d32565620881 Mon Sep 17 00:00:00 2001 From: infosec-intern Date: Fri, 22 Sep 2017 11:43:20 -0600 Subject: [PATCH] Formatted "Unknown MISP object" error message When a user tries to add an object with a name that doesn't exist, the error thrown was missing its format string This ended up looking like pymisp.exceptions.UnknownMISPObjectTemplate: {} is unknown in the MISP object directory. Here's a patch that adds self.name to the format string --- pymisp/mispevent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 0ff2424..f36be76 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -604,7 +604,7 @@ class MISPObject(AbstractMISP): self.__known_template = True else: if self.__strict: - raise UnknownMISPObjectTemplate('{} is unknown in the MISP object directory.') + raise UnknownMISPObjectTemplate('{} is unknown in the MISP object directory.'.format(self.name)) else: self.__known_template = False if self.__known_template: