mirror of https://github.com/mpv-player/mpv
js: custom init (~~/.init.js): fail loudly on errors
Previously, loading ~~/.init.js was inside a try block, in order to quietly ignore errors if the file doesn't exist. However, that also prevented any real errors from showing up even when the file does exist, and the script continued as if everything is OK, while in fact the custom init script didn't complete correctly. Now we first check if the file exists, and then load it without try/catch, so that any error shows up normally (and abort the script).
This commit is contained in:
parent
2d348980cb
commit
6123e97e31
|
@ -771,7 +771,7 @@ g.mp_event_loop = function mp_event_loop() {
|
|||
|
||||
})(this)
|
||||
|
||||
try {
|
||||
// let the user extend us, e.g. for updating mp.module_paths
|
||||
// let the user extend us, e.g. by adding items to mp.module_paths
|
||||
// (unlike e.g. read_file, file_info doesn't expand meta-paths)
|
||||
if (mp.utils.file_info(mp.utils.get_user_path("~~/.init.js")))
|
||||
require("~~/.init");
|
||||
} catch(e) {}
|
||||
|
|
Loading…
Reference in New Issue