From faebac75a727305cde0c440a4d5052d770fb4e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Sat, 11 Mar 2023 10:55:33 +0000 Subject: [PATCH] Fix Nomad Exit Code Due to the wrapping of the command, the exit code could not have been retrieved correct anymore. --- internal/nomad/sentry_debug_writer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/nomad/sentry_debug_writer.go b/internal/nomad/sentry_debug_writer.go index 22534b95..497880eb 100644 --- a/internal/nomad/sentry_debug_writer.go +++ b/internal/nomad/sentry_debug_writer.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "github.com/getsentry/sentry-go" - "github.com/openHPI/poseidon/pkg/dto" "io" "regexp" "strconv" @@ -17,7 +16,7 @@ var ( // Format Parameters: 1. Debug Comment, 2. command. timeDebugMessageFormatStart = timeDebugMessageFormat + `; %s` // Format Parameters: 1. command, 2. Debug Comment. - timeDebugMessageFormatEnd = `%s; ` + dto.WrapBashCommand(`ec=$?; `+timeDebugMessageFormat+` && exit $ec`) + timeDebugMessageFormatEnd = `%s; ec=$?; ` + timeDebugMessageFormat + ` && exit $ec` timeDebugMessagePattern = regexp.MustCompile( `(?P.*)\x1EPoseidon (?P.+) (?P