From: Jacco van den Berg Date: Wed, 20 Jul 2022 16:51:34 +0000 (+0200) Subject: Improve error message with id of the canvas (#10495) X-Git-Tag: v3.8.1~5 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a1e68380f1298ccb25e6941b07e158855ac4992;p=thirdparty%2FChart.js.git Improve error message with id of the canvas (#10495) * improve error message with id of the canvas * update test --- diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 17923d90a..907f4d198 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -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.' ); } diff --git a/test/specs/core.controller.tests.js b/test/specs/core.controller.tests.js index 4798f3307..90d31d061 100644 --- a/test/specs/core.controller.tests.js +++ b/test/specs/core.controller.tests.js @@ -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();