mulesoft/mule-devkit — Issue #53: Confusing message when Exception is thrown by MP
Author: jeluard
Created: 2011-12-01 18:33:35+00:00
State: open

Here is the stacktrace received when an exception is thrown by salesforce-connector#create processor:

```java
Exception in thread "main" org.mule.api.MessagingException: Failed to invoke create. Message payload is of type: HashMap
at org.mule.modules.salesforce.config.CreateMessageProcessor.process(CreateMessageProcessor.java:495)
at org.mule.tools.module.invocation.Invoker.invoke(Invoker.java:59)
at org.mule.tools.module.invocation.DynamicModule.invoke(DynamicModule.java:256)
at org.mule.tools.module.invocation.DynamicModule.invoke(DynamicModule.java:252)
at org.mule.tools.module.Main.main(Main.java:111)
Caused by: java.util.NoSuchElementException: Could not create a validated object, cause: The password for the user mulesap@googlemail.com has expired
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1219)
at org.mule.modules.salesforce.config.SalesforceModuleConnectionManager.acquireConnection(SalesforceModuleConnectionManager.java:241)
at org.mule.modules.salesforce.config.CreateMessageProcessor.process(CreateMessageProcessor.java:437)
... 4 more
```

I would suggest to:
* get rid of the confusing `Message payload is of type: HashMap`
* provide some hint of concrete exception on first level i.e. `Failed to invoke create: The password for the user mulesap@googlemail.com has expired`
* swallow common.pool exception which is useless