Improve error handling during launch (#21)
If anything happens to the forked process, the main should now pick up on it and alert the user. Should no longer get 'stuck at 100%' issues when the forked process fails, for whatever reason.
This commit is contained in:
@@ -534,7 +534,12 @@ exports.pullRemote = function(){
|
||||
const distroDest = path.join(ConfigManager.getLauncherDirectory(), 'distribution.json')
|
||||
request(opts, (error, resp, body) => {
|
||||
if(!error){
|
||||
data = DistroIndex.fromJSON(JSON.parse(body))
|
||||
|
||||
try {
|
||||
data = DistroIndex.fromJSON(JSON.parse(body))
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
|
||||
fs.writeFile(distroDest, body, 'utf-8', (err) => {
|
||||
if(!err){
|
||||
|
||||
Reference in New Issue
Block a user