Commit f4fdf8f8 authored by bseeger's avatar bseeger
Browse files

Adds in better error handling.

parent a73f7621
......@@ -71,8 +71,15 @@ public class EntailmentRouter extends RouteBuilder {
.setHeader("Accept").constant(DEFAULT_CONTENT_TYPE)
.to("fcrepo:{{fcrepo.baseUrl}}?throwExceptionOnFailure=false" +
"&preferOmit={{prefer.omit}}&preferInclude={{prefer.include}}")
.setHeader(HTTP_RESPONSE_CODE).constant(200)
.setHeader("Accept").header(ENTAILMENT_ACCEPT)
.to("direct:getTriples");
.choice()
.when(header(HTTP_RESPONSE_CODE).isEqualTo(200))
.setHeader("Accept").header(ENTAILMENT_ACCEPT)
.to("direct:getTriples")
.otherwise()
.to("direct:error");
from("direct:error").routeId("EntailmentError")
.setBody(constant("Error: this resource is not accessible"))
.setHeader(CONTENT_TYPE).constant("text/plain");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment