Thanks to visit codestin.com
Credit goes to github.com

Skip to content

URIParsingContext are usually wrong in some way #582

@Niels-Erik

Description

@Niels-Erik

In developing for #514 I have found that the URIParsingContexts provide wrong line numbers either in startLine method or the enclosingCodeWithLineNumbers method.

I have 2 examples, where the normal fault messege is printed followed by a line with sourceName() concatenated with startLine(), with the last line being the output of enclosingCodeWithLineNumbers():

The first is in the called service where the fault comes from throw( error, "an error" ) on line 25 according to VS code.
Here we see the enclosingCodeWithLineNumbers() method gives wrong line number and data:

Feb 12, 2025 5:59:48 PM thrower.ol
INFO: [throwembed2.ol -> thrower.ol -> bug] Thrown unhandled fault: error
Content (if any):string = "an error"
/workspaces/jolie/test/../faultlinesManualTests/thrower.ol:25
        26:            res 

The second is the caller which calls the called service with add@test(1)(c) on line 15.
Here we see the startLine() method giving the wrong line number:

Feb 12, 2025 5:59:48 PM throwembed2.ol
INFO: [throwembed2.ol] Thrown unhandled fault: error
Content (if any):string = "an error"
/workspaces/jolie/test/../faultlinesManualTests/throwembed2.ol:14
        15:        add@test(

I do not know if #581 fixes these cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions