[SERVER-18664] Refactor command error handling Created: 26/May/15 Updated: 19/Sep/15 Resolved: 03/Jun/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 3.1.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Adam Midvidy | Assignee: | Adam Midvidy |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Platform 4 06/05/15 | ||||||||
| Participants: | |||||||||
| Description |
|
Right now we catch AssertionException/UserException multiple times and duplicate the same logic for generating error responses throughout the command execution pipeline. We should make one method to generate an error reply, and let all exceptions bubble up to a canonical place where it is called. |
| Comments |
| Comment by Githook User [ 03/Jun/15 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: style responses |
| Comment by Githook User [ 03/Jun/15 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: |
| Comment by Adam Midvidy [ 26/May/15 ] |
|
Also, while it would be nice to only have one catch block, we need more as we will have additional context further down the stack that we should expose in error messages. |
| Comment by Adam Midvidy [ 26/May/15 ] |
|
I need this for the metadata refactor as we can now throw an exception in receivedCommand/receivedRpc if there is invalid metadata. This fix is needed to generate the correct command reply rather than returning a $err error message. |