Ballerina-lang: Need to rephrase the error message given when the org name is missing from an import

Created on 3 Oct 2018  路  4Comments  路  Source: ballerina-platform/ballerina-lang

Support I have a package called foo and it is installed to my local repo. And then I try to use it in a program as follows:

import foo;

public function main() {
    foo:Foo f = {};
}

This results in the following error:

    invalid organization name recieved: '$anon'. organization name should be lowercase and alphanumeric, underscore is can be used. should be less than 256 characters.
error: ./test3.bal:1:1: cannot resolve package 'foo'
error: ./test3.bal:4:5: undefined package 'foo'
error: ./test3.bal:4:17: invalid literal for type 'other'
compilation contains errors

The first of these error messages which is from the Ballerina Central should be rephrased and the grammar mistakes should be corrected. Also, the $anon part is probably not the intended text there. Need to double check.

AreCentral TypBug TypImprovement

All 4 comments

If org name is unavailable, it shouldnt visit remote repo.

Wording will be changes to "invalid organization name received: '{{orgName}}'. organization name should be lowercase and alphanumeric. underscores can be used. should be less than 256 characters."

Shall we use proper capitalization from the second sentence onward? How about something like below?
"invalid organization name received: '{{orgName}}'. Only lowercase letters, numerals and underscores are allowed in an organization name and the maximum length is 256 characters."

We'll use lowercase alphanumerics instead of "lowercase letters, numerals".

Following are the error messages that will be given:

  • If the org-name is invalid : "error: invalid organization name provided 'foo-bar'. Only lowercase alphanumerics and underscores are allowed in an organization name and the maximum length is 256 characters"

  • If the package-name is invalid : "error: invalid package name provided 'hello-pkg'. Only alphanumerics, underscores and periods are allowed in a package name and the maximum length is 256 characters"

Was this page helpful?
0 / 5 - 0 ratings