core tests
Some checks failed
CI / lint-typecheck (push) Failing after 4m52s
CI / tests (push) Has been skipped
CI / contract-tests (push) Has been skipped
CI / e2e-tests (push) Has been skipped
CI / comment-pr (push) Has been skipped
CI / commit-types (push) Has been skipped

This commit is contained in:
2026-01-25 11:38:16 +01:00
parent 3db2209d2a
commit 9f219c0181
6 changed files with 34 additions and 7 deletions

View File

@@ -34,15 +34,21 @@ export class CheckApiHealthUseCase {
timestamp: result.timestamp,
});
} else {
const error = result.error || 'Unknown error';
await eventPublisher.publishHealthCheckFailed({
error: result.error || 'Unknown error',
error,
timestamp: result.timestamp,
});
// Return result with error property
return {
...result,
error,
};
}
return result;
} catch (error) {
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
const errorMessage = error instanceof Error ? error.message : (error ? String(error) : 'Unknown error');
const timestamp = new Date();
// Emit failed event