DEV: Make plugin api errors more descriptive (#15111)

With more descriptive errors, developers will know **why** a change is required, and may be more likely to take action.
This commit is contained in:
David Taylor 2021-11-26 20:22:29 +00:00 committed by GitHub
parent e8bb37bd89
commit 5d59b7e733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ function canModify(klass, type, resolverName, changes) {
if (!changes.pluginId) {
// eslint-disable-next-line no-console
console.warn(
"To prevent errors, add a `pluginId` key to your changes when calling `modifyClass`"
"To prevent errors in tests, add a `pluginId` key to your `modifyClass` call. This will ensure the modification is only applied once."
);
return true;
}
@ -1629,7 +1629,7 @@ function decorate(klass, evt, cb, id) {
if (!id) {
// eslint-disable-next-line no-console
console.warn(
"`decorateCooked` should be supplied with an `id` option to avoid memory leaks."
"`decorateCooked` should be supplied with an `id` option to avoid memory leaks in test mode. The id will be used to ensure the decorator is only applied once."
);
} else {
if (!_decorated.has(klass)) {