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

[Bug]: NPE thrown for cause() calls for errors created from API #42248

Closed
HindujaB opened this issue Feb 29, 2024 · 1 comment · Fixed by #42249 or #42253
Closed

[Bug]: NPE thrown for cause() calls for errors created from API #42248

HindujaB opened this issue Feb 29, 2024 · 1 comment · Fixed by #42249 or #42253
Assignees
Labels
Priority/Blocker Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Milestone

Comments

@HindujaB
Copy link
Contributor

Description

$subject
Happening for

public static BError createError(BString message, Throwable throwable) {
API usage.

Steps to Reproduce

In bal source,

error err = error_utils:getNullDetailError("error message");
error? c = err.cause(); // crashes with NPE

public function getNullDetailError(string msg) returns error = @java:Method {
    'class: "..."
} external;

In native code,

    public static BError getNullDetailError(BString msg) {
        return ErrorCreator.createError(msg, new NullPointerException("NPE"));
    }

Affected Version(s)

2201.8.5

OS, DB, other environment details and versions

No response

Related area

-> Runtime

Related issue(s) (optional)

https://github.com/wso2-enterprise/internal-support-ballerina/issues/608

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@HindujaB HindujaB added Type/Bug Priority/Blocker Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime labels Feb 29, 2024
@HindujaB HindujaB self-assigned this Feb 29, 2024
@HindujaB HindujaB linked a pull request Feb 29, 2024 that will close this issue
13 tasks
@HindujaB HindujaB linked a pull request Mar 1, 2024 that will close this issue
13 tasks
@Nuvindu Nuvindu added this to the 2201.8.6 milestone Mar 5, 2024
Copy link

github-actions bot commented Mar 7, 2024

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@HindujaB HindujaB added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/Blocker Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
Archived in project
2 participants