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

[Bug] Regular errors are reported as "Unexpected CLI Error" despite expected failure #491

Closed
3 tasks done
Tracked by #502 ...
Luna-Klatzer opened this issue Jul 24, 2023 · 4 comments · Fixed by #502 or #510
Closed
3 tasks done
Tracked by #502 ...
Assignees
Labels
bug Bug or issue in the language or API high priority High priority issue, discussion or pull request
Milestone

Comments

@Luna-Klatzer
Copy link
Member

Luna-Klatzer commented Jul 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

I am following the documentation's guide

  • I have read the documentation

This issue exists in the latest version

  • I am using the latest version

Current Behavior

With the latest version 0.10.3 there is a new bug, where certain queries cause an unexpected CLI error message.

For example:

  • The following cmd command:

    kipper run -s "x"

    returns:

    ERROR Compilation error - Traceback:
    File 'anonymous-script', line 1, col 1:
      x
    
    SyntaxError: Missing ';' at '<EOF>'.
    FATAL Failed to compile 'anonymous-script'.
     »   Unexpected CLI Error: Missing ';' at '<EOF>'.
     »   Try this: Ensure no invalid types or data were passed to module functions or classes. Otherwise report the issue on https://github.com/Kipper-Lang/Kipper. Help us improve Kipper!

Expected Behavior

The failure of the command should not counted as an "Unexpected CLI Error", as it is defined behaviour.

Steps To Reproduce

  1. Install version 0.10.3
  2. Call up CLI with any invalid flag or try to compile/run a syntax-invalid Kipper script.

Environment

  • Kipper: 0.10.3
  • Environment: v18.16.1
  • Operating System: Windows 11
@Luna-Klatzer Luna-Klatzer added the bug Bug or issue in the language or API label Jul 24, 2023
@Luna-Klatzer Luna-Klatzer added this to the v0.10.0 milestone Jul 24, 2023
@Luna-Klatzer Luna-Klatzer self-assigned this Jul 24, 2023
@Luna-Klatzer Luna-Klatzer changed the title [Bug] <title> [Bug] Regular errors are reported as "Unexpected Internal Error" despite expected failure Jul 24, 2023
@Luna-Klatzer Luna-Klatzer changed the title [Bug] Regular errors are reported as "Unexpected Internal Error" despite expected failure [Bug] Regular errors are reported as "Unexpected CLI Error" despite expected failure Jul 24, 2023
@Luna-Klatzer Luna-Klatzer added the high priority High priority issue, discussion or pull request label Aug 7, 2023
@Luna-Klatzer Luna-Klatzer pinned this issue Aug 7, 2023
Luna-Klatzer added a commit that referenced this issue Aug 15, 2023
Luna-Klatzer added a commit that referenced this issue Aug 15, 2023
Luna-Klatzer added a commit that referenced this issue Aug 15, 2023
This commit makes `KipperCompileResult.warnings` always be an array even if `compileCtx` is undefined. This is to preserve cohesion with the previous bug-fix release `v0.10.3`
Luna-Klatzer added a commit that referenced this issue Aug 15, 2023
@Luna-Klatzer
Copy link
Member Author

Fixed by #502 and will be released in the next release v0.10.4.

@Luna-Klatzer Luna-Klatzer unpinned this issue Aug 15, 2023
@Luna-Klatzer
Copy link
Member Author

Luna-Klatzer commented Oct 19, 2023

To be implemented as well for 0.11.0-alpha.1 (#510).

@Luna-Klatzer
Copy link
Member Author

Luna-Klatzer commented Oct 21, 2023

Uncovered edge-case discovered in 0.10.4:

Input:

kipper run --target=kip --string-code=";"

Result:

 »   Unexpected CLI Error: Expected --target=kip to be one of: js, ts
 »   See more help with --help
 »   Try this: Ensure no invalid types or data were passed to module functions or classes. Otherwise report the issue
 »   on https://github.com/Kipper-Lang/Kipper. Help us improve Kipper!

Cause:

The decorator prettifiedErrors<TProto extends Command>() doesn't treat CLIError from @oclif/errors as a standard CLI error, which is wrong.

Going to be fixed with PR #510 for next release 0.11.0-alpha.1.

Luna-Klatzer added a commit that referenced this issue Oct 21, 2023
Luna-Klatzer added a commit that referenced this issue Oct 21, 2023
Luna-Klatzer added a commit that referenced this issue Oct 21, 2023
…o-v0-11

Sync bug fixes for issues #435, #451 & #491 to `v0.11`
@Luna-Klatzer
Copy link
Member Author

Finished issue with merge of #510.

@Luna-Klatzer Luna-Klatzer mentioned this issue Feb 10, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or issue in the language or API high priority High priority issue, discussion or pull request
Projects
1 participant