diff --git a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/EndpointConstants.java b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/EndpointConstants.java index bcea7f55..192c3798 100644 --- a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/EndpointConstants.java +++ b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/EndpointConstants.java @@ -138,6 +138,7 @@ public class EndpointConstants { static final String NOT_SUPPORTED = "Trace type not supported"; //$NON-NLS-1$ static final String NO_SUCH_EXPERIMENT = "No such experiment"; //$NON-NLS-1$ static final String PROVIDER_NOT_FOUND = "Experiment or output provider not found"; //$NON-NLS-1$ + static final String TRACE_CREATION_FAILED = "Trace resource creation failed"; //$NON-NLS-1$ static final String TREE_ENTRIES = "Unique entry point for output providers, to get the tree of visible entries"; //$NON-NLS-1$ private EndpointConstants() { diff --git a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ExperimentManagerService.java b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ExperimentManagerService.java index c305872c..09325cac 100644 --- a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ExperimentManagerService.java +++ b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ExperimentManagerService.java @@ -263,7 +263,8 @@ public Response deleteExperiment(@Parameter(description = EXP_UUID) @PathParam(" @ApiResponse(responseCode = "200", description = "The experiment was successfully created", content = @Content(schema = @Schema(implementation = IExperiment.class))), @ApiResponse(responseCode = "204", description = "The experiment has at least one trace which hasn't been created yet", content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse(responseCode = "400", description = INVALID_PARAMETERS, content = @Content(schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "409", description = "The experiment (name) already exists and both differ", content = @Content(schema = @Schema(implementation = String.class))) + @ApiResponse(responseCode = "409", description = "The experiment (name) already exists and both differ", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "500", description = "Internal trace-server error while trying to post experiment", content = @Content(schema = @Schema(implementation = String.class))) }) public Response postExperiment(@RequestBody(content = { @Content(schema = @Schema(implementation = IExperimentQueryParameters.class)) diff --git a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/TraceManagerService.java b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/TraceManagerService.java index 73cab3da..86385997 100644 --- a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/TraceManagerService.java +++ b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/TraceManagerService.java @@ -16,6 +16,7 @@ import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.NAME_EXISTS; import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.NOT_SUPPORTED; import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.NO_SUCH_TRACE; +import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.TRACE_CREATION_FAILED; import static org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.EndpointConstants.TRACE_UUID; import java.io.File; @@ -153,6 +154,7 @@ private static Map initTraces() { @ApiResponse(responseCode = "404", description = NO_SUCH_TRACE, content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse(responseCode = "406", description = CANNOT_READ, content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse(responseCode = "409", description = NAME_EXISTS, content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "500", description = TRACE_CREATION_FAILED, content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse(responseCode = "501", description = NOT_SUPPORTED, content = @Content(schema = @Schema(implementation = String.class))) }) public Response putTrace(@RequestBody(content = { @@ -200,7 +202,7 @@ private static Response put(String path, String name, String typeID) IResource resource = getResource(path, name); if (!resource.exists()) { if (!createResource(path, resource)) { - return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Trace resource creation failed").build(); //$NON-NLS-1$ + return Response.status(Status.INTERNAL_SERVER_ERROR).entity(TRACE_CREATION_FAILED).build(); } resource.setPersistentProperty(TmfCommonConstants.TRACETYPE, traceType); } else {