-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix for unhandled exception when email limits are reached (#548)
* Added catch for System.HandledException in LoggerEmailSender.cls to avoid trying to send emails when the org's single email limit has been exceeded
- Loading branch information
1 parent
a08e1d6
commit 41e6594
Showing
7 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,17 @@ | |
@SuppressWarnings('PMD.MethodNamingConventions') | ||
@IsTest(IsParallel=true) | ||
private class LoggerEmailSender_Tests { | ||
@IsTest | ||
static void it_should_indicate_email_deliverability_is_disabled_when_org_limits_exceeded() { | ||
System.OrgLimit singleEmailOrgLimit = OrgLimits.getMap().get('SingleEmail'); | ||
|
||
// Reserve all of the available single email capacity, which is the effectively | ||
// the same as the email limit being exceeded in the org | ||
System.Messaging.reserveSingleEmailCapacity(singleEmailOrgLimit.getLimit()); | ||
|
||
System.Assert.isFalse(LoggerEmailSender.IS_EMAIL_DELIVERABILITY_ENABLED); | ||
} | ||
|
||
@IsTest | ||
static void it_should_filter_apex_error_recipients() { | ||
ApexEmailNotification emailListNotification = new ApexEmailNotification(Email = '[email protected];[email protected]', UserId = null); | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,9 @@ | |
"package": "Nebula Logger - Core", | ||
"path": "./nebula-logger/core", | ||
"definitionFile": "./config/scratch-orgs/base-scratch-def.json", | ||
"versionNumber": "4.11.2.NEXT", | ||
"versionName": "New Exception Methods for Apex", | ||
"versionDescription": "Added new method overloads Logger.exception() that automatically log, save, and throw the provided exception", | ||
"versionNumber": "4.11.3.NEXT", | ||
"versionName": "Bugfix for Unhandled Email Exception", | ||
"versionDescription": "Added an extra check in LoggerEmailSender to avoid sending more emails when the org's email limits have been exceeded", | ||
"releaseNotesUrl": "https://github.com/jongpie/NebulaLogger/releases", | ||
"unpackagedMetadata": { | ||
"path": "./nebula-logger/extra-tests" | ||
|
@@ -150,6 +150,7 @@ | |
"Nebula Logger - [email protected]'23-release": "04t5Y0000023SI6QAM", | ||
"Nebula Logger - [email protected]": "04t5Y000001TsX4QAK", | ||
"Nebula Logger - [email protected]": "04t5Y000001TsZAQA0", | ||
"Nebula Logger - [email protected]": "04t5Y000001HZd0QAG", | ||
"Nebula Logger - Core Plugin - Async Failure Additions": "0Ho5Y000000blO4SAI", | ||
"Nebula Logger - Core Plugin - Async Failure [email protected]": "04t5Y0000015lhiQAA", | ||
"Nebula Logger - Core Plugin - Async Failure [email protected]": "04t5Y0000015lhsQAA", | ||
|