[java-identity-provider COMMIT] /trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/mapping/AbstractS...

noreply at shibboleth.net noreply at shibboleth.net
Tue Jun 16 05:02:45 EDT 2015


Author: rdw
Date: Tue Jun 16 05:02:45 2015
New Revision: 7563

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7563&view=rev
Log:
IDP-741 Extra logging for mapping

https://issues.shibboleth.net/jira/browse/IDP-741 if the mapping throws an exception the logging is less than helpful.
Intercept exceptions, log and then rethrow.

Modified:
    trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/mapping/AbstractSAMLAttributesMapper.java

Modified: trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/mapping/AbstractSAMLAttributesMapper.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/mapping/AbstractSAMLAttributesMapper.java?rev=7563&r1=7562&r2=7563&view=diff
==============================================================================
--- trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/mapping/AbstractSAMLAttributesMapper.java	(original)
+++ trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/mapping/AbstractSAMLAttributesMapper.java	Tue Jun 16 05:02:45 2015
@@ -149,7 +149,14 @@
         for (final InType prototype : prototypes) {
             for (final AttributeMapper<InType,OutType> mapper : mappers) {
 
-                final Map<String,OutType> mappedAttributes = mapper.mapAttribute(prototype);
+                final Map<String,OutType> mappedAttributes;
+                try {
+                    mappedAttributes = mapper.mapAttribute(prototype); 
+                } catch (Exception e) {
+                    log.error("{} Attempt to map SAML attribute '{}' with mapper '{}' failed: ", getLogPrefix(),
+                            prototype.getName(),mapper.getId(), e);
+                    throw e;
+                }
 
                 log.debug("{} SAML attribute '{}' mapped to {} attributes by mapper '{}'", getLogPrefix(),
                         prototype.getName(), mappedAttributes.size(), mapper.getId());



More information about the commits mailing list