Skip to content

Commit

Permalink
Improve error message with id of the canvas (#10495)
Browse files Browse the repository at this point in the history
* improve error message with id of the canvas
* update test
  • Loading branch information
LeeLenaleee authored Jul 20, 2022
1 parent 97351d1 commit 1a1e683
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/core.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Chart {
if (existingChart) {
throw new Error(
'Canvas is already in use. Chart with ID \'' + existingChart.id + '\'' +
' must be destroyed before the canvas can be reused.'
' must be destroyed before the canvas with ID \'' + existingChart.canvas.id + '\' can be reused.'
);
}

Expand Down
2 changes: 1 addition & 1 deletion test/specs/core.controller.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Chart', function() {
expect(createChart).toThrow(new Error(
'Canvas is already in use. ' +
'Chart with ID \'' + chart.id + '\'' +
' must be destroyed before the canvas can be reused.'
' must be destroyed before the canvas with ID \'' + chart.canvas.id + '\' can be reused.'
));

chart.destroy();
Expand Down

0 comments on commit 1a1e683

Please sign in to comment.