You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
noOverwrite: true,// We don't want to automatically replace custom platforms the user might already have in place
38
35
});
39
-
}catch{}// If this fails, we still want to install the libraries
36
+
}catch(e){
37
+
// There's no error code, I need to parse the error message: https://github.com/arduino/arduino-cli/commit/ffe4232b359fcfa87238d68acf1c3b64a1621f14#diff-10ffbdde46838dd9caa881fd1f2a5326a49f8061f6cfd7c9d430b4875a6b6895R62
// If arduino:avr installation fails because it's already installed we don't want to retry on next start-up
44
+
console.error(e);
45
+
}else{
46
+
// But if there is any other error (e.g.: no interntet cconnection), we want to retry next time
47
+
avrPackageError=e;
48
+
}
49
+
}
50
+
}else{
51
+
avrPackageError=newError('Could not find platform.');
40
52
}
53
+
41
54
if(builtInLibrary){
42
55
try{
43
56
awaitthis.libraryService.install({
44
57
item: builtInLibrary,
45
58
installDependencies: true,
46
59
noOverwrite: true,// We don't want to automatically replace custom libraries the user might already have in place
47
60
});
48
-
}catch{}
61
+
}catch(e){
62
+
// There's no error code, I need to parse the error message: https://github.com/arduino/arduino-cli/commit/2ea3608453b17b1157f8a1dc892af2e13e40f4f0#diff-1de7569144d4e260f8dde0e0d00a4e2a218c57966d583da1687a70d518986649R95
63
+
if(
64
+
e.message.includes(
65
+
`Library ${builtInLibrary.name} is already installed`
66
+
)
67
+
){
68
+
// If Arduino_BuiltIn installation fails because it's already installed we don't want to retry on next start-up
69
+
console.log('error installing core',e);
70
+
}else{
71
+
// But if there is any other error (e.g.: no interntet cconnection), we want to retry next time
72
+
builtInLibraryError=e;
73
+
}
74
+
}
75
+
}else{
76
+
builtInLibraryError=newError('Could not find library');
77
+
}
78
+
79
+
if(avrPackageError){
80
+
this.messageService.error(
81
+
`Could not install Arduino AVR platform: ${avrPackageError}`
82
+
);
83
+
}
84
+
if(builtInLibraryError){
85
+
this.messageService.error(
86
+
`Could not install ${builtInLibrary.name} library: ${builtInLibraryError}`
0 commit comments