|
33 | 33 | import com.fasterxml.jackson.databind.JsonNode; |
34 | 34 | import com.fasterxml.jackson.databind.ObjectMapper; |
35 | 35 | import com.fasterxml.jackson.databind.node.JsonNodeType; |
36 | | -import com.marklogic.client.*; |
37 | 36 | import com.marklogic.client.DatabaseClientFactory.HandleFactoryRegistry; |
| 37 | +import com.marklogic.client.MarkLogicBindingException; |
| 38 | +import com.marklogic.client.MarkLogicIOException; |
| 39 | +import com.marklogic.client.MarkLogicInternalException; |
| 40 | +import com.marklogic.client.Transaction; |
38 | 41 | import com.marklogic.client.document.DocumentWriteSet; |
39 | 42 | import com.marklogic.client.expression.PlanBuilder; |
40 | 43 | import com.marklogic.client.expression.PlanBuilder.Plan; |
@@ -419,22 +422,11 @@ private RESTServiceResultIterator submitPlan(PlanBuilderBaseImpl.RequestPlan req |
419 | 422 | AbstractWriteHandle astHandle = requestPlan.getHandle(); |
420 | 423 | List<ContentParam> contentParams = requestPlan.getContentParams(); |
421 | 424 | final String path = determinePath(); |
422 | | - try { |
423 | | - if (contentParams != null && !contentParams.isEmpty()) { |
424 | | - contentParams.add(new ContentParam(new PlanBuilderBaseImpl.PlanParamBase("query"), astHandle, null)); |
425 | | - return services.postMultipartForm(requestLogger, path, transaction, params, contentParams); |
426 | | - } |
427 | | - return services.postIteratedResource(requestLogger, path, transaction, params, astHandle); |
428 | | - } catch (FailedRequestException ex) { |
429 | | - String message = ex.getMessage(); |
430 | | - if (message != null && message.contains("RESTAPI-UPDATEFROMQUERY")) { |
431 | | - String betterMessage = "The Optic plan is attempting an update but was sent to the wrong REST API endpoint. " + |
432 | | - "You must invoke `withUpdate(true)` on the instance of com.marklogic.client.row.RowManager that you " + |
433 | | - "are using to submit the plan"; |
434 | | - throw new FailedRequestException(betterMessage, ex.getFailedRequest()); |
435 | | - } |
436 | | - throw ex; |
437 | | - } |
| 425 | + if (contentParams != null && !contentParams.isEmpty()) { |
| 426 | + contentParams.add(new ContentParam(new PlanBuilderBaseImpl.PlanParamBase("query"), astHandle, null)); |
| 427 | + return services.postMultipartForm(requestLogger, path, transaction, params, contentParams); |
| 428 | + } |
| 429 | + return services.postIteratedResource(requestLogger, path, transaction, params, astHandle); |
438 | 430 | } |
439 | 431 |
|
440 | 432 | private PlanBuilderBaseImpl.RequestPlan checkPlan(Plan plan) { |
|
0 commit comments