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

use try{...}catch(e){...} can crash #27

Closed
GaN8373 opened this issue Dec 22, 2024 · 3 comments
Closed

use try{...}catch(e){...} can crash #27

GaN8373 opened this issue Dec 22, 2024 · 3 comments

Comments

@GaN8373
Copy link

GaN8373 commented Dec 22, 2024

Issue type:

  • 🐛 Bug

Short description:

Steps to reproduce the problem:

use script:

function f1(itemStackElement,networkStackExpr) {
    try {
        for (const element of itemStackElement) {
            let operatorApply = idContext.ops.operatorApply(networkStackExpr, element);
            if (operatorApply < 512) {
                console.log(`Operator Apply: ${operatorApply}`);

                return operatorApply;
            }

        }
    }catch(e) {
        console.log(e);
    }
}

Expected behaviour:


Versions:

  • This mod: 1.0.7-146
  • Minecraft: 1.21.1
  • Mod loader version: neoforge - 21.1.57

Log file:

crash-2024-12-23_00.02.08-server.txt

@rubensworks
Copy link
Member

Thanks for reporting!

@Jack-McKalling
Copy link
Contributor

Could you reproduce what you did to get this, in an environment with just Scripting installed (with dependencies)?
It looks like this might be a clear bug already but just in case.

@rubensworks rubensworks moved this from To Do to On hold (awaiting input) in Maintenance Dec 22, 2024
@GaN8373
Copy link
Author

GaN8373 commented Dec 23, 2024

crash-2024-12-23_12.49.29-server.txt
saves.zip
i directly use throw new Error().
The main reason for a crash is that no value is returned after catching an error

@rubensworks rubensworks moved this from On hold (awaiting input) to To Do in Maintenance Dec 23, 2024
@github-project-automation github-project-automation bot moved this from To Do to Done in Maintenance Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants