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
pull/112/head
infosec-intern 2017-09-22 11:43:20 -06:00 committed by GitHub
parent 7e797e5f6f
commit f08f744cc2
1 changed files with 1 additions and 1 deletions

View File

@ -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: