Skip to content

Commit

Permalink
Fix error handling in callback API
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuvindu committed Apr 10, 2024
1 parent 023da0f commit 42da72a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public class ExecutionCallback implements Callback {
}

@Override
public void notifySuccess(Object o) {
try {
Object jsonObject = JsonUtils.parse(StringUtils.getJsonString(o));
public void notifySuccess(Object result) {
if (result instanceof BError) {
this.future.complete(result);
} else {
Object jsonObject = JsonUtils.parse(StringUtils.getJsonString(result));
this.future.complete(ValueUtils.convert(jsonObject, typeDesc.getDescribingType()));
} catch (BError e) {
this.future.complete(e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion native/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

module io.ballerina.stdlib.serdes {
module io.ballerina.lib.serdes {
requires io.ballerina.runtime;
requires io.ballerina.lang;
requires org.apache.avro;
Expand Down

0 comments on commit 42da72a

Please sign in to comment.