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

Better Module_Does_Not_Exist exception #11713

Merged
merged 3 commits into from
Nov 29, 2024

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Nov 29, 2024

Pull Request Description

The previous code was throwing UnknownIdentifierException when a module wasn't found. That's pretty misleading. Especially when Truffle infrastructure converts such exception to another one. Enso has a dedicated error when module cannot be found. Let's use that one.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
  • Unit tests have been written where possible.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Nov 29, 2024
@JaroslavTulach JaroslavTulach self-assigned this Nov 29, 2024
@JaroslavTulach
Copy link
Member Author

Example of previous error:

    - [FAILED] Default Encoding heuristics also work in File.read [73ms]
        Reason: An unexpected panic was thrown: java.lang.UnsupportedOperationException: Non readable or non-existent member key 'get_module' for object 'Enso.Top_Scope'(language: Enso, type: Unknown).
        at <Unknown Location> related to org.graalvm.polyglot.Value<TopLevelScope>.invoke
        at <Unknown Location> related to com.oracle.truffle.host.HostObject.doInvoke
        at <enso> File_Format.format_types<arg-1>(C:\runner\_work\enso\enso\built-distribution\enso-engine-2024.5.1-dev-windows-amd64\enso-2024.5.1-dev\lib\Standard\Base\2024.5.1-dev\src\System\File_Format.enso:37:44-72)
        at <enso> File_Format.format_types(C:\runner\_work\enso\enso\built-distribution\enso-engine-2024.5.1-dev-windows-amd64\enso-2024.5.1-dev\lib\Standard\Base\2024.5.1-dev\src\System\File_Format.enso:37:16-73)

the new error will look like:

 - [FAILED] should return empty vector if no files were provided [2ms]
        Reason: An unexpected panic was thrown: (Module_Does_Not_Exist.Error 'Standard.Table.Return_As_Table')
        at <Unknown Location> related to org.graalvm.polyglot.Value<TopLevelScope>.invoke
        at <Unknown Location> related to com.oracle.truffle.host.HostObject.doInvoke
        at <enso> Return_As._get_known_return_classes<arg-1>(enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso:21:33-65)
        at <enso> Return_As._get_known_return_classes(enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso:21:5-66)
        at <enso> case_branch(enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso:51:21-45)
        at <enso> Return_As.type.resolve(enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso:41-58)
        at <enso> Data.read_many(enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data.enso:146:17-40)
        at <enso> File_Read_Spec.add_specs.windows_log<arg-1>(test/Base_Tests/src/System/File_Read_Spec.enso:145:18-53)

Co-authored-by: Pavel Marek <[email protected]>
@JaroslavTulach JaroslavTulach added the CI: Ready to merge This PR is eligible for automatic merge label Nov 29, 2024
@mergify mergify bot merged commit 52feef8 into develop Nov 29, 2024
42 checks passed
@mergify mergify bot deleted the wip/jtulach/Module_Does_Not_Exist branch November 29, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants