Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var configs = function configs (args) {
if (!args) {
// no arguments: return copy of configs object
return JSON.parse(JSON.stringify(this))
}
// apply log level if among arguments
if (args.logLevel) {
setLogLevel(args.logLevel)
delete args.logLevel
}
// prevent secret API key to be included in browser environments
if (runtime.isBrowser && args.secretApiKey) {
log.error('The secret API key is not supposed to be used in browser environments!\nPlease see https://3d.io/docs/api/1/get-started-browser.html#secret-api-key for more information.')
}
// simply copy over the other configs
var key, keys = Object.keys(args)
for (var i = 0, l = keys.length; i < l; i++) {
key = keys[i]
if (defaults[key] !== undefined) {
configs[key] = args[key]
} else {
log.warn('Unknown config param "' + key + '". Available params are: ' + Object.keys(defaults).join(', '))
}
}
return this
}
Vue.config.errorHandler = function (err, vm, info) {
Logger.error("Vue error: ", err);
};
window.onerror = function (errorMsg, url, lineNo, colNo, error) {
Logger.error("Global event: ", errorMsg);
Store.commitLoaderVisibility(store, false);
};
.catch(err => {
process.exitCode = 1;
if (err instanceof OptionsError) {
Logger.error(err.message);
} else if (err instanceof SnapToS3.SnapshotMigrationError) {
Logger.get(err.snapshotID).error(err);
Logger.error("");
Logger.error("Terminating due to fatal errors.");
} else if (err instanceof SnapToS3.SnapshotsMissingError) {
Logger.error(err);
} else {
Logger.error(err);
Logger.error("");
Logger.error("Terminating due to fatal errors.");
}
});
}
.catch(err => {
process.exitCode = 1;
if (err instanceof OptionsError) {
Logger.error(err.message);
} else if (err instanceof SnapToS3.SnapshotMigrationError) {
Logger.get(err.snapshotID).error(err);
Logger.error("");
Logger.error("Terminating due to fatal errors.");
} else if (err instanceof SnapToS3.SnapshotsMissingError) {
Logger.error(err);
} else {
Logger.error(err);
Logger.error("");
Logger.error("Terminating due to fatal errors.");
}
});
}
Vue.config.errorHandler = function (err, vm, info) {
Logger.error("Vue error: ", err);
};
window.onerror = function (errorMsg, url, lineNo, colNo, error) {
Logger.error("Global event: ", errorMsg);
Store.commitLoaderVisibility(store, false);
};
}).catch(function onError (error) {
log.error('Log out error.', error)
return Promise.reject(error)
})
}
.catch(err => {
process.exitCode = 1;
if (err instanceof OptionsError) {
Logger.error(err.message);
} else if (err instanceof SnapToS3.SnapshotMigrationError) {
Logger.get(err.snapshotID).error(err);
Logger.error("");
Logger.error("Terminating due to fatal errors.");
} else if (err instanceof SnapToS3.SnapshotsMissingError) {
Logger.error(err);
} else {
Logger.error(err);
Logger.error("");
Logger.error("Terminating due to fatal errors.");
}
});
}