Fix: error handling

pull/273/head
Frostebite 2021-06-06 23:44:50 +01:00
parent d0402e14b1
commit 3430d9b1f8
3 changed files with 6 additions and 6 deletions

5
dist/index.js vendored
View File

@ -803,6 +803,7 @@ class Kubernetes {
// run // run
yield this.runCloneJob(); yield this.runCloneJob();
yield this.runBuildJob(); yield this.runBuildJob();
yield this.cleanup();
} }
catch (error) { catch (error) {
core.error(JSON.stringify(error.response.body, undefined, 4)); core.error(JSON.stringify(error.response.body, undefined, 4));
@ -998,10 +999,8 @@ class Kubernetes {
yield this.streamLogs(); yield this.streamLogs();
} }
catch (error) { catch (error) {
throw error;
}
finally {
yield this.cleanup(); yield this.cleanup();
throw error;
} }
}); });
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -89,6 +89,8 @@ class Kubernetes implements RemoteBuilderProviderInterface {
// run // run
await this.runCloneJob(); await this.runCloneJob();
await this.runBuildJob(); await this.runBuildJob();
await this.cleanup();
} catch (error) { } catch (error) {
core.error(JSON.stringify(error.response.body, undefined, 4)); core.error(JSON.stringify(error.response.body, undefined, 4));
throw error; throw error;
@ -280,9 +282,8 @@ class Kubernetes implements RemoteBuilderProviderInterface {
await this.watchUntilPodRunning(); await this.watchUntilPodRunning();
await this.streamLogs(); await this.streamLogs();
} catch (error) { } catch (error) {
throw error;
} finally {
await this.cleanup(); await this.cleanup();
throw error;
} }
} }