refactor: add error processing for first connecting remote container
This commit is contained in:
12
src/home.ts
12
src/home.ts
@@ -32,11 +32,13 @@ export default class DSHome {
|
||||
switch (message.command) {
|
||||
case 'firstOpenRemoteFolder':
|
||||
await this.remoteContainer.firstConnect(message.host, message.username, message.password, message.port)
|
||||
.then((result) => {
|
||||
if (result === 'success') {
|
||||
// only success then open folder
|
||||
this.remoteContainer.openRemoteFolder(message.host, message.path);
|
||||
}
|
||||
.then((_res) => {
|
||||
if (_res == 'success') {
|
||||
// only success then open folder
|
||||
this.remoteContainer.openRemoteFolder(message.host, message.path);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error(`Failed to connect ${message.host}: `, error)
|
||||
})
|
||||
break;
|
||||
case 'openRemoteFolder':
|
||||
|
Reference in New Issue
Block a user