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

Add error:StackFrame[] as a key-value pair type #354

Merged
merged 5 commits into from Nov 5, 2021
Merged

Conversation

MadhukaHarith92
Copy link
Contributor

@MadhukaHarith92 MadhukaHarith92 commented Nov 5, 2021

Purpose

Fixes ballerina-platform/ballerina-library#2360

This change is related to the return type change of error:stackTrace() function. For more information refer [1]. This would change the log as follows.

Old log:

log:printError("error log", stackTrace = e.stackTrace().callStack);

New log:

log:printError("error log", stackTrace = e.stackTrace());

[1] https://github.com/ballerina-platform/ballerina-release/blob/beta4-language-changes/release-notes/swan-lake-beta4-release-note.md

Examples

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests

@ballerina-platform ballerina-platform deleted a comment from codecov bot Nov 5, 2021
@codecov
Copy link

codecov bot commented Nov 5, 2021

Codecov Report

Merging #354 (4f494ab) into master (d0456e4) will increase coverage by 0.44%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #354      +/-   ##
============================================
+ Coverage     88.28%   88.72%   +0.44%     
  Complexity        3        3              
============================================
  Files             4        4              
  Lines           128      133       +5     
  Branches         76       79       +3     
============================================
+ Hits            113      118       +5     
  Misses           14       14              
  Partials          1        1              
Impacted Files Coverage Δ
ballerina/natives.bal 93.39% <100.00%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0456e4...4f494ab. Read the comment docs.

@@ -46,5 +46,5 @@ function f2() {

function f3() {
error e = error("bad sad");
log:printDebug("debug log", stackTrace = e.stackTrace().callStack, username = "Alex92", id = 845315);
log:printDebug("debug log", stackTrace = e.stackTrace(), username = "Alex92", id = 845315);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn’t this be a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change from ballerina-lang. The error:stackTrace() function does not return a CallStack oblect. Now it returns error:StackFrame[][1].

[1] https://github.com/ballerina-platform/ballerina-release/blob/beta4-language-changes/release-notes/swan-lake-beta4-release-note.md

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add this to.the release note and go ahead.

Copy link
Contributor

@BuddhiWathsala BuddhiWathsala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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