Skip to content

Commit 8118a13

Browse files
committed
Merged PR 126401: [JS samples][minor] Fixed error/errors typo
In several places in our samples, the error handling code uses different names for the same variable (`error` vs. `errors`): ``` .catch(function (error) { Log.log(errors); }); ``` This causes an exception if there's an error
1 parent 24dd64d commit 8118a13

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

demo/v2-demo/scripts/codesamples.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ function _Report_UpdateSettings() {
891891
Log.logText("Filter pane was removed.");
892892
})
893893
.catch(function (error) {
894-
Log.log(errors);
894+
Log.log(error);
895895
});
896896
}
897897

@@ -1342,7 +1342,7 @@ function _Report_ApplyCustomLayout() {
13421342
Log.logText("Custom layout applied, to remove custom layout, reload the report using 'Reload' API.")
13431343
})
13441344
.catch(function (error) {
1345-
Log.log(errors);
1345+
Log.log(error);
13461346
});
13471347
}
13481348

@@ -1374,7 +1374,7 @@ function _Report_HideAllVisualHeaders() {
13741374
Log.logText("Visual header was successfully hidden for all the visuals in the report.");
13751375
})
13761376
.catch(function (error) {
1377-
Log.log(errors);
1377+
Log.log(error);
13781378
});
13791379

13801380
}
@@ -1406,7 +1406,7 @@ function _Report_ShowAllVisualHeaders() {
14061406
Log.logText("Visual header was successfully shown for all the visuals in the report.");
14071407
})
14081408
.catch(function (error) {
1409-
Log.log(errors);
1409+
Log.log(error);
14101410
});
14111411

14121412
}
@@ -1450,7 +1450,7 @@ function _Report_HideSingleVisualHeader() {
14501450
Log.logText("Visual header was successfully hidden for 'Category Breakdown' visual.");
14511451
})
14521452
.catch(function (error) {
1453-
Log.log(errors);
1453+
Log.log(error);
14541454
});
14551455
}
14561456

@@ -1598,7 +1598,7 @@ function _Report_Extensions_OptionsMenu() {
15981598
// Update the settings by passing in the new settings you have configured.
15991599
report.updateSettings(newSettings)
16001600
.catch(function (error) {
1601-
Log.log(errors);
1601+
Log.log(error);
16021602
});
16031603

16041604
// Report.on will add an event handler to commandTriggered event which prints to console window.
@@ -1644,7 +1644,7 @@ function _Report_Extensions_ContextMenu() {
16441644
// Update the settings by passing in the new settings you have configured.
16451645
report.updateSettings(newSettings)
16461646
.catch(function (error) {
1647-
Log.log(errors);
1647+
Log.log(error);
16481648
});
16491649

16501650
// Report.on will add an event handler to commandTriggered event which prints to console window.
@@ -2231,7 +2231,7 @@ function _Bookmarks_Enable() {
22312231
// Update the settings by passing in the new settings you have configured.
22322232
report.updateSettings(newSettings)
22332233
.catch(function (error) {
2234-
Log.log(errors);
2234+
Log.log(error);
22352235
});
22362236
}
22372237

@@ -2254,7 +2254,7 @@ function _Bookmarks_Disable() {
22542254
// Update the settings by passing in the new settings you have configured.
22552255
report.updateSettings(newSettings)
22562256
.catch(function (error) {
2257-
Log.log(errors);
2257+
Log.log(error);
22582258
});
22592259
}
22602260

@@ -2726,7 +2726,7 @@ function _ReportVisual_UpdateSettings() {
27262726
Log.logText("Filter pane was added.");
27272727
})
27282728
.catch(function (error) {
2729-
Log.log(errors);
2729+
Log.log(error);
27302730
});
27312731
}
27322732

@@ -2769,7 +2769,7 @@ function _ReportVisual_HideSingleVisualHeader() {
27692769
Log.logText("Visual header was successfully hidden for 'Sentiment by Year and Months' visual.");
27702770
})
27712771
.catch(function (error) {
2772-
Log.log(errors);
2772+
Log.log(error);
27732773
});
27742774
}
27752775

0 commit comments

Comments
 (0)