Skip to content

Commit 74bcc12

Browse files
committed
moved location of k8 con.on error
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 9f95021 commit 74bcc12

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/k8.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,12 @@ export class K8 {
615615
this.logger.debug(`copyFrom.callback(status)=${status}`)
616616
})
617617
.then(conn => {
618+
conn.on('error', (e) => {
619+
self._deleteTempFile(tmpFile)
620+
return reject(new FullstackTestingError(
621+
`failed copying from ${podName}:${srcDir}/${srcFile} to ${destPath} because of connection error: ${e.message}`, e))
622+
})
623+
618624
conn.on('close', (code, reason) => {
619625
this.logger.debug(`connection closed copying from ${podName}:${srcDir}/${srcFile} to ${destPath}`)
620626
if (code !== 1000) { // code 1000 is the success code
@@ -667,12 +673,6 @@ export class K8 {
667673
return resolve(true)
668674
}
669675
})
670-
671-
conn.on('error', (e) => {
672-
self._deleteTempFile(tmpFile)
673-
return reject(new FullstackTestingError(
674-
`failed copying from ${podName}:${srcDir}/${srcFile} to ${destPath} because of connection error: ${e.message}`, e))
675-
})
676676
})
677677

678678
errStream.on('data', (data) => {

0 commit comments

Comments
 (0)