diff --git a/force-app/main/default/classes/RollbarExceptionEmailHandler.cls b/force-app/main/default/classes/RollbarExceptionEmailHandler.cls index 0ccaf0a..ca10313 100644 --- a/force-app/main/default/classes/RollbarExceptionEmailHandler.cls +++ b/force-app/main/default/classes/RollbarExceptionEmailHandler.cls @@ -1,35 +1,35 @@ global class RollbarExceptionEmailHandler implements Messaging.InboundEmailHandler { - global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, - Messaging.InboundEnvelope env){ - - // Create an InboundEmailResult object for returning the result of the - // Apex Email Service - Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); - - try { - try { - parseAndSend(email); - } catch(Exception exc) { - exc.getStackTraceString(); // without those calls strack trace string is not populated - throw new ExceptionEmailParsingException('Unable to process unhandled exception email', exc); - } - } catch(ExceptionEmailParsingException wrapper) { - wrapper.getStackTraceString(); // without those calls strack trace string is not populated - - Map custom = new Map(); - custom.put('email_body', getUnknownEmailBody(email)); - - Rollbar.log(wrapper, custom); - } + global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, + Messaging.InboundEnvelope env){ + + // Create an InboundEmailResult object for returning the result of the + // Apex Email Service + Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); + + try { + try { + parseAndSend(email); + } catch(Exception exc) { + exc.getStackTraceString(); // without those calls strack trace string is not populated + throw new ExceptionEmailParsingException('Unable to process unhandled exception email', exc); + } + } catch(ExceptionEmailParsingException wrapper) { + wrapper.getStackTraceString(); // without those calls strack trace string is not populated + + Map custom = new Map(); + custom.put('email_body', getUnknownEmailBody(email)); + + Rollbar.log(wrapper, custom); + } - // Set the result to true. No need to send an email back to the user - // with an error message - result.success = true; + // Set the result to true. No need to send an email back to the user + // with an error message + result.success = true; - // Return the result for the Apex Email Service - return result; - } + // Return the result for the Apex Email Service + return result; + } private void parseAndSend(Messaging.InboundEmail email) { RollbarSettings__c settings = RollbarSettings__c.getOrgDefaults();