fix: logs for not running containers

This commit is contained in:
Andras Bacsai
2022-10-10 15:28:46 +02:00
parent d4b7318413
commit 6882e83d1e
4 changed files with 42 additions and 25 deletions

View File

@@ -1243,7 +1243,10 @@ export async function getApplicationLogs(request: FastifyRequest<GetApplicationL
return { logs: sortedLogs }
// }
} catch (error) {
const { statusCode } = error;
const { statusCode, stderr } = error;
if (stderr.startsWith('Error: No such container')) {
return { logs: [], noContainer: true }
}
if (statusCode === 404) {
return {
logs: []