Created
June 15, 2010 23:34
-
-
Save ddossot/439903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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