remove try/catch block to give better error messages#13
Conversation
|
IMHO It's probably also ok to only alter |
|
I think it's already comprehensible, as the stack trace will show that you messed up your webpack config :-) You should not throw an error you can't catch anyway... A zillion different things could go wrong in your webpack config, there is no way to have a good error message in dyncfg at this point. |
|
We added the try/catch for a reason... It was kind of hard to figure out whats wrong. Anyway we only modify it in case of a "file not found" error. I agree with @acidicX that it's not ideal, but you should still be able to figure out webpack errors with the try/catch in place. Or is it a "MODULE_NOT_FOUND" error in any case? |
Yep. That is the problem. |
That was exactly the case with the current implementation because it was claiming that the config file was not found although it was in place. The error happened somewhere upstream but was obscured because any context information was missing. We could alter the error message, but I'm not sure if that's necessary. IMHO the stack trace contains all the necessary information (even that the error happened in dynamic-config). |
The try/catch blocks kills the stack trace required to find any errors in your webpack config, e.g. missing modules.