Created
April 23, 2019 18:14
-
-
Save gashupl/7932eee89b12bfc488f22edb1a167216 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| try | |
| { | |
| //Validate input and run business logic here… | |
| } | |
| catch (InvalidPluginExecutionException e) | |
| { | |
| throw; | |
| } | |
| catch (CustomIntegrationException e) | |
| { | |
| //Save information about exception in external database | |
| //and queue integration request for the future processing | |
| } | |
| catch (OutOfMemoryException e) | |
| { | |
| throw new InvalidPluginExecutionException(OperationStatus.Failed, e.Message); | |
| } | |
| catch (StackOverflowException e) | |
| { | |
| throw new InvalidPluginExecutionException(OperationStatus.Failed, e.Message); | |
| } | |
| catch (ThreadAbortException e) | |
| { | |
| throw new InvalidPluginExecutionException(OperationStatus.Failed, e.Message); | |
| } | |
| catch (Exception e) | |
| { | |
| tracingService?.Trace($"Plugin failed unexpectedly: '{this.Name}'"); | |
| tracingService.Trace($"Exception: {e}"); | |
| throw new InvalidPluginExecutionException(OperationStatus.Failed, "Sorry, the action failed unexpectedly!"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment