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) {
 | 
					        switch (message.command) {
 | 
				
			||||||
          case 'firstOpenRemoteFolder':
 | 
					          case 'firstOpenRemoteFolder':
 | 
				
			||||||
            await this.remoteContainer.firstConnect(message.host, message.username, message.password, message.port)
 | 
					            await this.remoteContainer.firstConnect(message.host, message.username, message.password, message.port)
 | 
				
			||||||
              .then((result) => {
 | 
					            .then((_res) => {
 | 
				
			||||||
                if (result === 'success') {
 | 
					              if (_res == 'success') {
 | 
				
			||||||
                  //  only success then open folder
 | 
					                //  only success then open folder
 | 
				
			||||||
                  this.remoteContainer.openRemoteFolder(message.host, message.path);
 | 
					                this.remoteContainer.openRemoteFolder(message.host, message.path);
 | 
				
			||||||
                }
 | 
					              }
 | 
				
			||||||
 | 
					            }).catch(error => {
 | 
				
			||||||
 | 
					              console.error(`Failed to connect ${message.host}: `, error)
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
          case 'openRemoteFolder':
 | 
					          case 'openRemoteFolder':
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user