Skip to content

Commit

Permalink
fix(api): more info about LoadNodeJobRun (#5186)
Browse files Browse the repository at this point in the history
  • Loading branch information
yesnault authored May 18, 2020
1 parent 7491dbd commit d1a3a18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engine/api/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (api *API) postRegisterWorkerHandler() service.Handler {
if workerTokenFromHatchery.Worker.JobID != 0 {
job, err := workflow.LoadNodeJobRun(ctx, tx, api.Cache, workerTokenFromHatchery.Worker.JobID)
if err != nil {
return sdk.NewErrorWithStack(err, sdk.ErrForbidden)
return sdk.NewErrorWithStack(sdk.WrapError(err, "error on LoadNodeJobRun with jobID %d", workerTokenFromHatchery.Worker.JobID), sdk.ErrForbidden)
}
groupIDs = sdk.Groups(job.ExecGroups).ToIDs()
} else {
Expand Down
1 change: 1 addition & 0 deletions engine/worker/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func runCmd() func(cmd *cobra.Command, args []string) {
fields := logrus.Fields{}
if isErrWithStack {
fields["stack_trace"] = fmt.Sprintf("%+v", err)
fields["request_id"] = sdk.ExtractHTTPError(err, "").RequestID
}
log.ErrorWithFields(ctx, fields, "%v", err)
time.Sleep(2 * time.Second)
Expand Down

0 comments on commit d1a3a18

Please sign in to comment.