Skip to content

Commit

Permalink
explicit error
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Dec 26, 2024
1 parent f81e165 commit 0b9c4bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/extension-support/extension-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class ExtensionManager {

/**
* Regenerate blockinfo for any loaded extensions
* @param {string=} optExtensionId Optional extension ID for refreshing
* @param {string} [optExtensionId] Optional extension ID for refreshing
* @returns {Promise} resolved once all the extensions have been reinitialized
*/
refreshBlocks (optExtensionId) {
Expand All @@ -289,7 +289,10 @@ class ExtensionManager {
.catch(e => {
log.error('Failed to refresh built-in extension primitives', e);
});
if (optExtensionId && this._loadedExtensions.has(optExtensionId)) {
if (optExtensionId) {
if (!this._loadedExtensions.has(optExtensionId)) {
throw new Error(`Unknown extension: ${optExtensionId}`);
}
return refresh(this._loadedExtensions.get(optExtensionId));
}
const allPromises = Array.from(this._loadedExtensions.values()).map(refresh);
Expand Down

0 comments on commit 0b9c4bd

Please sign in to comment.