You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server: Introduce ErrorResponse and use it everywhere
When an error is created when processing a client request, return
an ErrorResponse JSON object that includes
- title: short, human-readable description of the error
- detail: optional, human-readable explanation of the error
This standardizes the error response to common data structure. The
field names and purpose are inspired by RFC 9457.
For 409 errors (trace or experiment) return extended ErrorResponse
containing the conflicting trace or experiment respectively.
This commit also updates the swagger documentation in respect to the
ErrorResponses accordingly.
This commit also fixes some incorrect or missing the swagger
definitions.
Add description to Trace and Experiment model so that they are not
overridden by the experiment/trace error description.
Contributes to fix issue:
eclipse-cdt-cloud/trace-server-protocol#122
Signed-off-by: Bernd Hufmann <[email protected]>
Copy file name to clipboardExpand all lines: trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests/src/org/eclipse/tracecompass/incubator/trace/server/jersey/rest/core/tests/services/DataProviderConfigurationServiceTest.java
Copy file name to clipboardExpand all lines: trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests/src/org/eclipse/tracecompass/incubator/trace/server/jersey/rest/core/tests/services/ExperimentManagerServiceTest.java
privatestaticfinalStringEXPERIMENT_NAME_EXISTS = "The experiment (name) already exists and both differ."; //$NON-NLS-1$
69
+
privatestaticfinalStringEXPERIMENT_NAME_EXISTS_DETAIL = "The experiment with same name already exists with conflicting parameters. Use a different name to avoid the conflict."; //$NON-NLS-1$
70
+
67
71
/**
68
72
* Basic test for the {@link ExperimentManagerService}
69
73
*/
@@ -195,11 +199,16 @@ public void testPostConflicts() {
assertEquals("Conflict should return original experiment", EXPECTED, traceObj);
199
207
assertEquals("There should still be only one experiment", ImmutableSet.of(EXPECTED), getExperiments(expTarget));
200
208
assertEquals("Failing to add an experiment should not change the trace set", traceSet, getTraces(traces));
201
209
assertEquals("Failed to get the experiment by its UUID", EXPECTED, expTarget.path(expStub.getUUID().toString()).request().get(ExperimentModelStub.class));
202
210
}
211
+
203
212
// Post same experiment name, but with traces with the same names, but not the same traces
204
213
List<String> traceUUIDs3 = newArrayList<>();
205
214
traceUUIDs3.add(arm64Stub.getUUID().toString());
@@ -209,7 +218,11 @@ public void testPostConflicts() {
assertEquals("Conflict should return original experiment", EXPECTED, traceObj);
213
226
assertEquals("There should still be only one experiment", ImmutableSet.of(EXPECTED), getExperiments(expTarget));
214
227
assertEquals("Failing to add an experiment should not change the trace set", traceSet, getTraces(traces));
215
228
assertEquals("Failed to get the new experiment by its UUID", EXPECTED, expTarget.path(expStub.getUUID().toString()).request().get(ExperimentModelStub.class));
Copy file name to clipboardExpand all lines: trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests/src/org/eclipse/tracecompass/incubator/trace/server/jersey/rest/core/tests/services/TimeGraphDataProviderServiceTest.java
0 commit comments