-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: throw error when local iconDir
fails to load
#259
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -62,6 +62,7 @@ export function createPlugin( | |||
moduleGraph.invalidateAll(); | |||
} catch (ex) { | |||
// Failed to load the local collection | |||
throw new Error(`Failed to load local collection at: ${iconDir}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this throw or should this remove the local collection then invalidate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an error is thrown, it breaks the whole server, effectively stopping everything from running until the configuration is reloaded.
Here are a couple of options:
- Report the error and continue
- Silently create the folder and continue
- Throw an error and stop the server until the error is fixed
The first two options resolve the issue, but trying to load a local icon will just break everything afterwards as the file will not exist.
Creating the folder may give a slightly better experience though.
When
iconDir
doesn't exist. Any changes made to files will stop working due to how the code is set to callmoduleGraph.invalidateAll()
only after all icons are loaded.This change adds an error message that the local collection has failed to load.
Resolves: #260