From 1a1e68380f1298ccb25e6941b07e158855ac4992 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Wed, 20 Jul 2022 18:51:34 +0200 Subject: [PATCH] Improve error message with id of the canvas (#10495) * improve error message with id of the canvas * update test --- src/core/core.controller.js | 2 +- test/specs/core.controller.tests.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.' ); } 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();