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

Fixed bug of regular errors being reported as unexpected cli error despite expected failure #502

Conversation

Luna-Klatzer
Copy link
Member

@Luna-Klatzer Luna-Klatzer commented Aug 15, 2023

What type of change does this PR perform?

  • Bug fix (Non-breaking change which fixes an issue)

Summary

Fixed bugs in the @kipper/cli and @kipper/core packages, where some error-handling edge cases weren't covered and caused issues.

Closes #491

List of Changes

  • Unified error reporting behaviour in KipperCompiler.compile(). This means that syntax errors will not be thrown anymore unless the argument abortOnFirstError is specified, but also that syntax errors will be returned through a KipperCompileResult instance that stores them in the errors property. (Same behaviour as with semantic or type errors) This also means that KipperCompileResult.programCtx can now be undefined, if there has been a syntax error, as at that stage of compilation it can not be created.
  • Multiple bug fixes to resolve invalidly reported errors as explained in [Bug] Regular errors are reported as "Unexpected CLI Error" despite expected failure #491.
  • Deprecated CLI flag --abort-on-first-error. This does not include the compile argument CompileConfig.abortOnFirstError.

Does this PR create new warnings?

No.

Detailed Changelog

Changed

  • Moved function executeKipperProgram to Run as a private function.
  • Moved class KipperCompileResult to new file compile-result.ts in the same directory.
  • Field KipperCompileResult.programCtx can now be also undefined, due to the changed behaviour that now
    a KipperCompileResult is also returned for syntax errors (where it has no value).

Fixed

  • CLI error handling bug as described in #491. This includes
    multiple bugs where errors were reported as "Unexpected CLI Error".

Deprecated

  • CLI flag --abort-on-first-error in favour of --no-recover. #501.

Linked issues or PRs

@Luna-Klatzer Luna-Klatzer added bug Bug or issue in the language or API fix Fixes an issue or bug labels Aug 15, 2023
@Luna-Klatzer Luna-Klatzer added this to the v0.10.0 milestone Aug 15, 2023
@Luna-Klatzer Luna-Klatzer self-assigned this Aug 15, 2023
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
./kipper/web/kipper-standalone.min.js 128.56 KB (0%) 2.6 s (0%) 321 ms (+44.97% 🔺) 2.9 s
./kipper/web/kipper-standalone.js 128.6 KB (0%) 2.6 s (0%) 297 ms (+2.24% 🔺) 2.9 s

@Luna-Klatzer Luna-Klatzer merged commit 75c78ef into dev-main Aug 15, 2023
20 checks passed
@Luna-Klatzer Luna-Klatzer deleted the 491-bug-regular-errors-are-reported-as-unexpected-cli-error-despite-expected-failure branch August 15, 2023 12:36
@Luna-Klatzer Luna-Klatzer restored the 491-bug-regular-errors-are-reported-as-unexpected-cli-error-despite-expected-failure branch October 21, 2023 10:34
@Luna-Klatzer Luna-Klatzer deleted the 491-bug-regular-errors-are-reported-as-unexpected-cli-error-despite-expected-failure branch October 21, 2023 11:51
@Luna-Klatzer Luna-Klatzer mentioned this pull request Feb 10, 2024
16 tasks
This was referenced Jun 24, 2024
@Luna-Klatzer Luna-Klatzer mentioned this pull request Jul 10, 2024
41 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 fix Fixes an issue or bug
Projects
Development

Successfully merging this pull request may close these issues.

[Bug] Regular errors are reported as "Unexpected CLI Error" despite expected failure
1 participant