[MGNLACTIVATION-109] Change execute method from class ActivationCommand to throw more specific exceptions Created: 28/May/15 Updated: 01/Jun/16 Resolved: 01/Jun/16 |
|
| Status: | Closed |
| Project: | Activation |
| Component/s: | None |
| Affects Version/s: | 5.3.2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Richard Gange | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | support | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Date of First Response: | |||||||||||||
| Description |
|
The class ActivationCommand throws a generic Exception in its execute method. The primary reason why we should avoid throwing Generic Exceptions, Throwable, Error etc is that doing in this way prevents classes from catching the intended exceptions. Thus, a caller cannot examine the exception to determine why it was thrown and consequently cannot attempt recovery.
|
| Comments |
| Comment by Jan Haderka [ 31/Aug/15 ] |
|
Regarding your second comment - |
| Comment by Jan Haderka [ 01/Jun/16 ] |
|
The reason why activation throws generic Exception is that it doesn't know what other, more specific, possible exceptions might be coming from client receiving the activation result. As customers can implement their own specific transport mechanism or subscription it is not possible to constrain exceptions without being too restrictive. |