Skip to content

Commit c01207c

Browse files
committed
imporve error messages;
1 parent a7d3dff commit c01207c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/satosa/backends/saml2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def _translate_response(self, response, state):
273273
except AttributeError:
274274
pass
275275

276-
satosa_logging(logger, logging.DEBUG, "received attributes:\n%s" % json.dumps(response.ava, indent=4), state)
276+
satosa_logging(logger, logging.DEBUG, "backend received attributes:\n%s" % json.dumps(response.ava, indent=4), state)
277277
return internal_resp
278278

279279
def _metadata_endpoint(self, context):

src/satosa/base.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .plugin_loader import load_request_microservices, load_response_microservices
1818
from .routing import ModuleRouter, SATOSANoBoundEndpointError
1919
from .state import cookie_to_state, SATOSAStateError, State, state_to_cookie
20+
from saml2.s_utils import UnknownSystemEntity
2021

2122

2223
logger = logging.getLogger(__name__)
@@ -131,7 +132,7 @@ def _auth_resp_finish(self, context, internal_response):
131132
if user_id_to_attr:
132133
internal_response.attributes[user_id_to_attr] = [internal_response.user_id]
133134

134-
# Hash all attributes specified in INTERNAL_ATTRIBUTES["hash]
135+
# Hash all attributes specified in INTERNAL_ATTRIBUTES["hash"]
135136
hash_attributes = self.config["INTERNAL_ATTRIBUTES"].get("hash", [])
136137
internal_attributes = internal_response.attributes
137138
for attribute in hash_attributes:
@@ -259,9 +260,14 @@ def run(self, context):
259260
except SATOSANoBoundEndpointError:
260261
raise
261262
except SATOSAError:
262-
satosa_logging(logger, logging.ERROR, "Uncaught SATOSA error", context.state,
263+
satosa_logging(logger, logging.ERROR, "Uncaught SATOSA error ", context.state,
263264
exc_info=True)
264265
raise
266+
except UnknownSystemEntity as err:
267+
satosa_logging(logger, logging.ERROR,
268+
"configuration error: unknown system entity " + str(err),
269+
context.state, exc_info=False)
270+
raise
265271
except Exception as err:
266272
satosa_logging(logger, logging.ERROR, "Uncaught exception", context.state,
267273
exc_info=True)

0 commit comments

Comments
 (0)