mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Chain exception cause on create failure
Propogate root cause of exceptions thrown from createCollection and createMap. Issue: SPR-9285
This commit is contained in:
@@ -255,7 +255,8 @@ public abstract class CollectionFactory {
|
||||
return (Collection) collectionType.newInstance();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalArgumentException("Could not instantiate Collection type: " + collectionType.getName());
|
||||
throw new IllegalArgumentException("Could not instantiate Collection type: " +
|
||||
collectionType.getName(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -322,7 +323,8 @@ public abstract class CollectionFactory {
|
||||
return (Map) mapType.newInstance();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalArgumentException("Could not instantiate Map type: " + mapType.getName());
|
||||
throw new IllegalArgumentException("Could not instantiate Map type: " +
|
||||
mapType.getName(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user