Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream is not returning custom error type when using next() #21481

Closed
sinthuja opened this issue Mar 4, 2020 · 1 comment
Closed

Stream is not returning custom error type when using next() #21481

sinthuja opened this issue Mar 4, 2020 · 1 comment
Assignees
Labels
Lang/Streams Type `stream` and its implementation related issues Type/Bug

Comments

@sinthuja
Copy link
Contributor

sinthuja commented Mar 4, 2020

Description:
My iterator returns 'public function next() returns record{| record{} value; |}| sql:Error?', but when I do stream.next(), it's not returning my custom error - 'Error', and it's returning generic 'error' type. And hence I couldn't do,

record{| NumericInvalidColumn value; |}|sql:Error? data =  streamData.next();

And I can only do.

record{| NumericInvalidColumn value; |}|error? data =  streamData.next();

Compilation error:

    ERROR: .::query-test.bal:71:64:: incompatible types: expected '(record {| NumericInvalidColumn value; |}|ballerina/sql:DatabaseError|ballerina/sql:ApplicationError)?', found '(record {| NumericInvalidColumn value; |}|error)?'
        at org.ballerinalang.test.util.BRunUtil.getInvokedFunction(BRunUtil.java:1143)
        at org.ballerinalang.test.util.BRunUtil.invokeFunction(BRunUtil.java:1162)
        at org.ballerinalang.jdbc.query.NumericTypesQueryTest.testQueryNumericTypeRecord(NumericTypesQueryTest.java:83)
@sinthuja sinthuja added Type/Bug Lang/Streams Type `stream` and its implementation related issues labels Mar 4, 2020
@sinthuja sinthuja added this to the Ballerina 1.2.0 milestone Mar 4, 2020
@gimantha gimantha removed their assignment Mar 7, 2020
@mohanvive
Copy link
Contributor

Fixed with #21524 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lang/Streams Type `stream` and its implementation related issues Type/Bug
Projects
None yet
Development

No branches or pull requests

4 participants