From 3fb184028924ac45ae7e8bf269a4282ac6464642 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 22 May 2018 10:03:06 -0400 Subject: [PATCH] safer error class --- stix2/datastore/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stix2/datastore/__init__.py b/stix2/datastore/__init__.py index ac03959..c2963e2 100644 --- a/stix2/datastore/__init__.py +++ b/stix2/datastore/__init__.py @@ -40,8 +40,9 @@ class DataSourceError(Exception): def __str__(self): if self.root_exception: - self.message = "{} \"{}\"".format(self.message, self.root_exception) - return self.message + return "{} \"{}\"".format(self.message, self.root_exception) + else: + return self.message class DataStoreMixin(object): @@ -149,7 +150,7 @@ class DataStoreMixin(object): obj (STIX object OR dict OR str): The STIX object (or its ID) whose relationships will be looked up. relationship_type (str): Only retrieve Relationships of this type. - If None, all relationships will be returned, regardless of type. + If None, all relationships will be returned, regardless of type. source_only (bool): Only retrieve Relationships for which this object is the source_ref. Default: False. target_only (bool): Only retrieve Relationships for which this