From 988484271efd7eadb27d1e84acbc91cf2beac50d Mon Sep 17 00:00:00 2001 From: OrganomagnesiumHalide <99297401+OrganomagnesiumHalide@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:11:56 -0800 Subject: [PATCH] Mission exception default mutable argument (#946) * Fixed bug 690 * Fixed issues #639 and #690 * Remove unrelated changes --------- Co-authored-by: Cameron Brown --- mil_common/mil_missions/mil_missions_core/exceptions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mil_common/mil_missions/mil_missions_core/exceptions.py b/mil_common/mil_missions/mil_missions_core/exceptions.py index 5a178b578..b229cf7e5 100644 --- a/mil_common/mil_missions/mil_missions_core/exceptions.py +++ b/mil_common/mil_missions/mil_missions_core/exceptions.py @@ -13,8 +13,12 @@ class MissionException(Exception): parameters (Dict[Any, Any]): ??? """ - def __init__(self, message): - super(Exception, self).__init__(message) + def __init__(self, message, parameters=None): + if parameters is None: + parameters = {} + + self.message = message + self.parameters = parameters class TimeoutException(Exception):