Skip to content

Instantly share code, notes, and snippets.

@ddossot
Created June 15, 2010 23:34
Show Gist options
  • Save ddossot/439903 to your computer and use it in GitHub Desktop.
Save ddossot/439903 to your computer and use it in GitHub Desktop.
package org.mule;
import org.mule.api.MuleEventContext;
import code.lucamarrocco.hoptoad.HoptoadNotice;
import code.lucamarrocco.hoptoad.HoptoadNotifier;
public class HoptoadExceptionStrategy extends DefaultExceptionStrategy {
private final HoptoadNotifier hoptoadNotifier = new HoptoadNotifier();
private String apiKey;
private String environmentName;
public void setApiKey(final String apiKey) {
this.apiKey = apiKey;
}
public void setEnvironmentName(final String environmentName) {
this.environmentName = environmentName;
}
@Override
public void exceptionThrown(final Exception e) {
super.exceptionThrown(e);
final MuleEventContext eventContext = RequestContext.getEventContext();
final HoptoadNotice hoptoadNotice = new MuleHoptoadNoticeBuilder(apiKey, e, environmentName, eventContext).newNotice();
hoptoadNotifier.notify(hoptoadNotice);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment