Skip to content

Commit d1a3a18

Browse files
authored
fix(api): more info about LoadNodeJobRun (#5186)
1 parent 7491dbd commit d1a3a18

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

engine/api/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (api *API) postRegisterWorkerHandler() service.Handler {
6161
if workerTokenFromHatchery.Worker.JobID != 0 {
6262
job, err := workflow.LoadNodeJobRun(ctx, tx, api.Cache, workerTokenFromHatchery.Worker.JobID)
6363
if err != nil {
64-
return sdk.NewErrorWithStack(err, sdk.ErrForbidden)
64+
return sdk.NewErrorWithStack(sdk.WrapError(err, "error on LoadNodeJobRun with jobID %d", workerTokenFromHatchery.Worker.JobID), sdk.ErrForbidden)
6565
}
6666
groupIDs = sdk.Groups(job.ExecGroups).ToIDs()
6767
} else {

engine/worker/cmd_run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func runCmd() func(cmd *cobra.Command, args []string) {
6969
fields := logrus.Fields{}
7070
if isErrWithStack {
7171
fields["stack_trace"] = fmt.Sprintf("%+v", err)
72+
fields["request_id"] = sdk.ExtractHTTPError(err, "").RequestID
7273
}
7374
log.ErrorWithFields(ctx, fields, "%v", err)
7475
time.Sleep(2 * time.Second)

0 commit comments

Comments
 (0)