Skip to content

Commit

Permalink
Return meaningful error in case of plugin script failed to load
Browse files Browse the repository at this point in the history
  • Loading branch information
bajrangCoder authored Dec 4, 2024
1 parent c0747ea commit 24fbfb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/loadPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function loadPlugin(pluginId, justInstalled = false) {
const $script = <script src={Url.join(baseUrl, "main.js")}></script>;

$script.onerror = (error) => {
reject(new Error(`Failed to load script for plugin ${pluginId}`));
reject(new Error(`Failed to load script for plugin ${pluginId}: ${error.message || error}`));
};

$script.onload = async () => {
Expand Down

0 comments on commit 24fbfb2

Please sign in to comment.