Skip to content

Commit

Permalink
fix: catch error if test ExApp not registered (#293)
Browse files Browse the repository at this point in the history
Resolves: #292

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
  • Loading branch information
andrey18106 and bigcat88 authored May 21, 2024
1 parent 16312e5 commit 4881048
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 4 additions & 2 deletions lib/Controller/DaemonConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ public function startTestDeploy(string $name): Response {
}

$exApp = $this->exAppService->getExApp(Application::TEST_DEPLOY_APPID);
$status = $exApp->getStatus();
if ($exApp === null) {
return new JSONResponse(['error' => $this->l10n->t('ExApp failed to register, check the NC logs')], Http::STATUS_INTERNAL_SERVER_ERROR);
}

return new JSONResponse([
'status' => $status,
'status' => $exApp->getStatus(),
]);
}

Expand Down
12 changes: 4 additions & 8 deletions src/components/DaemonConfig/DaemonTestDeploy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,10 @@ export default {
this.statusChecks.register.passed = true
this.statusChecks.register.loading = false
}
}).catch(() => {
}).catch((err) => {
if (err.response.data.error) {
showError(err.response.data.error)
}
this.stopDeployTest()
}).finally(() => {
this.startingTest = false
Expand All @@ -279,13 +282,6 @@ export default {
.then(res => {
this.startDeployTestPolling()
return res
}).catch(err => {
console.debug(err)
if (err.data.error) {
showError(err.data.error)
}
this.clearTestRunning()
return err
}).finally(() => {
this.getAllDaemons()
})
Expand Down

0 comments on commit 4881048

Please sign in to comment.