[
https://issues.jboss.org/browse/TEIID-4047?page=com.atlassian.jira.plugin...
]
Ramesh Reddy commented on TEIID-4047:
-------------------------------------
currently I have like below, but once I check in we can fine tune it.
{code}
@Override
public void processError(ODataServerError error, ErrorResponse response) {
error.getException().printStackTrace(); //TODO: remove this
LogManager.logDetail(LogConstants.CTX_ODATA, error.getException());
Throwable ex = getRoot(error.getException());
if (ex instanceof TeiidProcessingException) {
error.setException((TeiidProcessingException)ex);
error.setCode(((TeiidProcessingException)ex).getCode());
error.setStatusCode(400);
} else if (ex instanceof TeiidException) {
error.setException((TeiidException)ex);
error.setCode(((TeiidException)ex).getCode());
error.setStatusCode(500);
} else if (ex instanceof TeiidRuntimeException) {
error.setException((TeiidRuntimeException)ex);
error.setCode(((TeiidRuntimeException)ex).getCode());
error.setStatusCode(500);
}
response.writeError(error);
}
private Throwable getRoot(Throwable t) {
if (t.getCause() != null && t.getCause() != t) {
if (t.getCause() instanceof TeiidException || t.getCause() instanceof
TeiidRuntimeException) {
return t.getCause();
}
return getRoot(t.getCause());
}
return t;
}
(code}
OData - $top with negative value return status code 500
-------------------------------------------------------
Key: TEIID-4047
URL:
https://issues.jboss.org/browse/TEIID-4047
Project: Teiid
Issue Type: Sub-task
Components: OData
Reporter: Juraj DurĂ¡ni
Assignee: Ramesh Reddy
OData request with query option $top with negative value returns status code 500. The
root cause is SQLException. OData service should check passed value and return e.g. 400
instead.
*URL:*
http://localhost:8080/odata4/olingo_basic/Source/Customers/?$top=-1
See
http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-pr...
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)