-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Allowing a null Status presents a lot of edge cases to check for, when it does not make sense to have a Response (a donkey response or the User API wrapper) without a Status.
Additional context
Doing some preliminary checks, I can't find any code that explicitly checks for null. In the fixStatus method below, null is converted to ERROR and returns an "invalid status" message. Not all code calls this method to fix the status.
engine/donkey/src/main/java/com/mirth/connect/donkey/model/message/Response.java
Lines 229 to 243 in 8f103d6
| public String fixStatus(boolean queueEnabled) { | |
| Status status = getStatus(); | |
| if (status != Status.ERROR && status != Status.SENT && status != Status.QUEUED) { | |
| // If the response is invalid for a final destination status, change the status to ERROR | |
| setStatus(Status.ERROR); | |
| return "Invalid response status: " + status + ". Status updated to ERROR."; | |
| } else if (!queueEnabled && status == Status.QUEUED) { | |
| // If the status is QUEUED and queuing is disabled, change the status to ERROR | |
| setStatus(Status.ERROR); | |
| return "Invalid response status. Cannot set status to QUEUED while queuing is disabled. Status updated to ERROR."; | |
| } | |
| return null; | |
| } |
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request