From a9d5e71956ad9bf1bd08b9a097f909ed90eff24e Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Wed, 20 Jul 2022 17:17:44 +0200 Subject: [PATCH 1/2] improve error message with id of the canvas --- src/core/core.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 17923d90aba..907f4d198ec 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.' ); } From 5825efc9af90fc62717519e6a1a2be2661991249 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Wed, 20 Jul 2022 17:28:16 +0200 Subject: [PATCH 2/2] update test --- test/specs/core.controller.tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/specs/core.controller.tests.js b/test/specs/core.controller.tests.js index 4798f330753..90d31d06162 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();