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

[Enhancement] Unified content and style of KCL error messages. #527

Closed
7 of 8 tasks
Peefy opened this issue Apr 23, 2023 · 0 comments · Fixed by #1105
Closed
7 of 8 tasks

[Enhancement] Unified content and style of KCL error messages. #527

Peefy opened this issue Apr 23, 2023 · 0 comments · Fixed by #1105
Assignees
Labels
error-handling Issues or PRs related to kcl error handling help wanted Extra attention is needed long-term refactor

Comments

@Peefy
Copy link
Contributor

Peefy commented Apr 23, 2023

Enhancement

takes 2 argument -> takes 2 arguments

_func = lambda x: int, y: int -> int {
    x - y
}  # Ok
_func = lambda x: int, y: int -> str {
    str(x + y)
}  # Error: function (int, int) -> str can't be assigned to function (int, int) -> int
a = "{ID}".format(2) # keyword argument not found -> keyword argument 'ID' not found
  • Enhance value union conflict error message

  • Error positions for undefined lambda parameters

image

  • Positional argument error not found for schema
schema D[name: str]: # ''
    n: str = name

d = D() { # expected 1 positional argument, found 0
    n = ""
}
  • Name not found in the schema expression
schema Person:
    image: str
    check:
        regex.match(image, "^[a-zA-Z]+:\d+\.\d+\.\d+$"), "image name should be like 'nginx:1.14.2'" # regex package is not importted
@Peefy Peefy added help wanted Extra attention is needed error-handling Issues or PRs related to kcl error handling refactor labels Apr 23, 2023
@Peefy Peefy added this to the v0.5.0 Release milestone Apr 23, 2023
@Peefy Peefy modified the milestones: v0.5.0 Release, v0.6.0 Release Jul 12, 2023
@Peefy Peefy removed this from the v0.6.0 Release milestone Sep 11, 2023
@Peefy Peefy added this to the v0.7.0 Release milestone Sep 18, 2023
@Peefy Peefy removed this from the v0.7.0 Release milestone Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-handling Issues or PRs related to kcl error handling help wanted Extra attention is needed long-term refactor
Projects
No open projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

2 participants