Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling #4

Merged
merged 6 commits into from
Dec 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed debugging code
TheSlimvReal committed Dec 12, 2023
commit 1de78103ac20ab0d762682e014fb34406fb16a29
2 changes: 2 additions & 0 deletions .github/workflows/main-push.yml
Original file line number Diff line number Diff line change
@@ -26,3 +26,5 @@ jobs:
tags: aamdigital/deployer-ms:latest
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
RUN_TESTS=${{ true }}
3 changes: 2 additions & 1 deletion src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -67,13 +67,14 @@ export class AppController {
const result = new Subject();
const tail = new Tail('dist/assets/log.txt');
tail.on('line', (line: string) => {
console.log('processing line', line);
if (line.startsWith('ERROR')) {
// Error found, text after error is returned
const message = line.replace('ERROR ', '');
result.error(new BadRequestException(message));
result.complete();
tail.unwatch();
} else if (line.startsWith('DONE')) {
// Success, app is deployed
result.next({ ok: true });
result.complete();
tail.unwatch();
Empty file added src/assets/log.txt
Empty file.