Skip to content

Commit

Permalink
Configuration RS services : Provide handling of ConfigurationExceptio…
Browse files Browse the repository at this point in the history
…n to return user readable messages #2814
  • Loading branch information
vrindanayak committed Oct 7, 2020
1 parent cf8ea24 commit 63e9947
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ public Response getAttributeFilter(@PathParam("Entity") String entityName) {
.writeAttributeFilter(writer, entity, filter);
gen.flush();
}).build();
} catch (IllegalStateException e) {
} catch (IllegalArgumentException | IllegalStateException e) {
return errResponse(e.getMessage(), Response.Status.NOT_FOUND);
} catch (IllegalArgumentException e) {
return errResponse(e.getMessage(), Response.Status.BAD_REQUEST);
} catch (Exception e) {
return errResponseAsTextPlain(exceptionAsString(e), Response.Status.INTERNAL_SERVER_ERROR);
}
Expand Down
75 changes: 66 additions & 9 deletions dcm4chee-arc-ui2/src/swagger/paths/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"200": {
"$ref": "../responses.json#/DeviceName"
},
"404": {
"description": "Archive device extension unavailable"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -78,6 +81,9 @@
"200": {
"$ref": "../responses.json#/deviceList"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -110,6 +116,9 @@
"404": {
"description": "Device configuration not found"
},
"409": {
"description": "Any other configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -145,13 +154,13 @@
"description": "successful operation"
},
"400": {
"description": "Device Name in request body didn't match with Device Name in URL or JSON request body was not well formed"
"description": "Device Name in request body didn't match with Device Name in URL or JSON request body was not well formed or invalid configuration content"
},
"404": {
"description": "Referenced devices/configuration not found"
},
"409": {
"description": "Device, Application Entity, HL7 Application or Web Application already exists"
"description": "Device, Application Entity, HL7 Application or Web Application already exists or any other configuration exception"
},
"500": {
"description": "Internal Server Error."
Expand Down Expand Up @@ -188,13 +197,13 @@
"description": "successful operation"
},
"400": {
"description": "Device Name in request body didn't match with Device Name in URL or JSON request body was not well formed"
"description": "Device Name in request body didn't match with Device Name in URL or JSON request body was not well formed or invalid configuration content"
},
"404": {
"description": "Device not found or referenced device/configuration not found"
},
"409": {
"description": "Device, Application Entity, HL7 Application or Web Application already exists"
"description": "Device, Application Entity, HL7 Application or Web Application already exists or any other configuration exception"
},
"500": {
"description": "Internal Server Error."
Expand Down Expand Up @@ -222,6 +231,9 @@
"404": {
"description": "Device not found"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -257,6 +269,9 @@
"404": {
"description": "Device not found"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -291,6 +306,9 @@
"404": {
"description": "Device not found"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand All @@ -314,6 +332,9 @@
"404": {
"description": "Device not found"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -341,6 +362,9 @@
}
}
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand All @@ -364,7 +388,7 @@
"description": "successful operation"
},
"409": {
"description": "AE Title already registered"
"description": "AE Title already registered or any other configuration exception"
},
"500": {
"description": "Internal Server Error."
Expand All @@ -389,6 +413,9 @@
"404": {
"description": "AE Title not found"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -416,6 +443,9 @@
}
}
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand All @@ -439,7 +469,7 @@
"description": "successful operation"
},
"409": {
"description": "Web Application already registered"
"description": "Web Application already registered or any other configuration exception"
},
"500": {
"description": "Internal Server Error."
Expand All @@ -464,6 +494,9 @@
"404": {
"description": "Web Application not found"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -491,6 +524,9 @@
}
}
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand All @@ -514,7 +550,7 @@
"description": "successful operation"
},
"409": {
"description": "HL7 Application already registered"
"description": "HL7 Application already registered or any other configuration exception"
},
"500": {
"description": "Internal Server Error."
Expand All @@ -539,6 +575,9 @@
"404": {
"description": "HL7 Application not found"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -576,6 +615,9 @@
"200": {
"$ref": "../responses.json#/aeList"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -644,6 +686,9 @@
"200": {
"$ref": "../responses.json#/webAppList"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -672,6 +717,9 @@
"200": {
"$ref": "../responses.json#/hl7AppList"
},
"409": {
"description": "Any configuration exception"
},
"500": {
"description": "Internal Server Error."
}
Expand All @@ -697,6 +745,9 @@
}
}
},
"404": {
"description": "Archive device extension unavailable"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -727,7 +778,7 @@
}
},
"404": {
"description": "entity not found"
"description": "Invalid entity or no attribute filter configured for entity"
},
"500": {
"description": "Internal Server Error."
Expand Down Expand Up @@ -759,7 +810,7 @@
}
},
"404": {
"description": "Attribute Set type not found"
"description": "Attribute Set type not found or archive device extension unavailable"
},
"500": {
"description": "Internal Server Error."
Expand Down Expand Up @@ -815,6 +866,9 @@
}
}
},
"404": {
"description": "Archive device extension unavailable"
},
"500": {
"description": "Internal Server Error."
}
Expand Down Expand Up @@ -844,6 +898,9 @@
}
}
},
"404": {
"description": "Archive device extension unavailable"
},
"500": {
"description": "Internal Server Error."
}
Expand Down

0 comments on commit 63e9947

Please sign in to comment.