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

Needed to maintain listing in k6 Extensions Registry #9

Open
javaducky opened this issue Jul 7, 2023 · 2 comments
Open

Needed to maintain listing in k6 Extensions Registry #9

javaducky opened this issue Jul 7, 2023 · 2 comments

Comments

@javaducky
Copy link

We've recently updated the requirements for maintaining an extension within the listing on our site. As such, please address the following items to maintain your listing within the registry:

  • add the xk6 topic to your repository metadata
  • needs to build with a recent version of k6; minimum v0.43

For more information on these and other listing requirements, please take a look at the registry requirements.

@chlins
Copy link
Member

chlins commented Jul 31, 2023

@javaducky Hi, thanks for your update, but we ran into a situation after upgrade the k6 to v0.45, I would like for some suggestions or best practices from k6 team. Here is our question, in the previous version, we used common.Throw to throw error from the golang module and then we can use the try catch to catch up the error from the JS scripts, but since we upgraded to the latest k6, the error cannot be caught from js.

Sample code:

export function setup() {
    // harbor.initialize(settings.Harbor)

    try {
        harbor.deleteProject('library')
    } catch (e) {
        console.log(e)
    }
}

previous behavior if an error occurred:

INFO[0000] GoError: failed to delete project library, error: project library not found  source=console

after upgrade the error seems lost:

INFO[0004] {"value":{}}                                  source=console

@chlins
Copy link
Member

chlins commented Aug 1, 2023

Found the problem is caused by the error object, when use console.log(e.stack) or console.log(e.message) it can print the expected error message like previous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants