From 6f36de4a087d76a894f2ba22797bcfa943ccd6d0 Mon Sep 17 00:00:00 2001 From: Daniel Tesfai Date: Tue, 3 Sep 2019 17:07:43 -0400 Subject: [PATCH] handling bugs in exceptions.py --- voipms/base/exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/voipms/base/exceptions.py b/voipms/base/exceptions.py index 764d698..a8b08ef 100644 --- a/voipms/base/exceptions.py +++ b/voipms/base/exceptions.py @@ -408,7 +408,8 @@ class VoipException(Exception): 'used_speed_dial': 'You have an entry with this Speed Dial', 'used_username': 'You already have a subaccount using this Username.', 'weak_password': 'This Password is too weak or too common'} - return "API Call failed as: {}".format(err_code_map[self.err_code]) + err_desc = err_code_map[self.err_code] or self.err_code + return "API Call failed as: {}".format(err_desc)