autoconfig: wrap most code in try…catch
Make debugging easier by printing exceptions to the log. For example: main() failed: TypeError: fragment.contains is not a function
This commit is contained in:
parent
49e6a9866b
commit
e2f29799c6
1 changed files with 19 additions and 8 deletions
|
@ -249,8 +249,8 @@ function css_files_update() {
|
|||
set_firefox_version_previous(ff);
|
||||
}
|
||||
|
||||
function main() {
|
||||
log("Running mobile-config-autoconfig.js");
|
||||
|
||||
css_files_update();
|
||||
|
||||
// Restart Firefox immediately if one of the files got updated
|
||||
|
@ -260,4 +260,15 @@ else
|
|||
set_default_prefs();
|
||||
|
||||
log("Done");
|
||||
}
|
||||
|
||||
try {
|
||||
main();
|
||||
} catch(e) {
|
||||
log("main() failed: " + e);
|
||||
|
||||
// Let Firefox display the generic error message that something went wrong
|
||||
// in the autoconfig script.
|
||||
error;
|
||||
}
|
||||
logFileStream.close();
|
||||
|
|
Loading…
Reference in a new issue