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
Observed this error with caching client. Caching client build the payload with as blob first. The program retrieves the payload as json. But the payload type is xml. The thrown error by the json parser is caught but processed with null balfuture.
Can be reproduced with
service / on inResponseCachedPayloadListener {
resourcefunction get checkJson() returnsjson|error {
http:ClientdiseaseEndpoint=checknew ("http://localhost:"+inResponseCachedPayloadTestBEPort.toString());
http:Responseresp=checkdiseaseEndpoint->get("/getXml");
byte[] b =checkresp.getBinaryPayload(); // represents cache behaviourreturnresp.getJsonPayload();
}
}
service / on inResponseCachedPayloadBEListener {
resourcefunction get getXml(http:Callercaller) {
http:Responseresponse=new;
xml xmlStr =xml`<name>Ballerina</name>`;
response.setXmlPayload(xmlStr);
error?result=caller->respond(response);
}
}
or
service / on inResponseCachedPayloadListener {
resourcefunction get checkJson() returnsjson|error {
http:ClientdiseaseEndpoint=checknew ("http://localhost:"+inResponseCachedPayloadTestBEPort.toString());
http:Responseresp=checkdiseaseEndpoint->get("/getXml");
returnresp.getJsonPayload();
}
}
service / on inResponseCachedPayloadBEListener {
resourcefunction get getXml(http:Callercaller) {
http:Responseresponse=new;
xml xmlStr =xml`<name>Ballerina</name>`;
response.setXmlPayload(xmlStr);
// enables cache behaviourresponse.setHeader("Cache-Control", "public, max-age=14400");
response.setHeader("etag", "W/\"25f-VB/B7cwRxpkTFPnufB0QcTCzHUE\"");
error?result=caller->respond(response);
}
}
Description:
Execptions thrown from https://github.com/ballerina-platform/module-ballerina-http/blob/d5e06bea9b722923ac033491fffa711f70b28f7e/http-native/src/main/java/org/ballerinalang/net/http/nativeimpl/ExternHttpDataSourceBuilder.java#L92 are catched and processed with NULL balFuture
Steps to reproduce:
Client
Affected Versions:
beta1
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered: