mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: propagate job error codes (#6507)
* feat: propagate job error_code * fix * Fix * Fix * Fix * add errors to typesGenerated * Address PR comments * Fix
This commit is contained in:
@@ -113,6 +113,7 @@ func (server *Server) AcquireJob(ctx context.Context, _ *proto.Empty) (*proto.Ac
|
||||
String: errorMessage,
|
||||
Valid: true,
|
||||
},
|
||||
ErrorCode: job.ErrorCode,
|
||||
})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("update provisioner job: %w", err)
|
||||
@@ -639,12 +640,17 @@ func (server *Server) FailJob(ctx context.Context, failJob *proto.FailedJob) (*p
|
||||
String: failJob.Error,
|
||||
Valid: failJob.Error != "",
|
||||
}
|
||||
job.ErrorCode = sql.NullString{
|
||||
String: failJob.ErrorCode,
|
||||
Valid: failJob.ErrorCode != "",
|
||||
}
|
||||
|
||||
err = server.Database.UpdateProvisionerJobWithCompleteByID(ctx, database.UpdateProvisionerJobWithCompleteByIDParams{
|
||||
ID: jobID,
|
||||
CompletedAt: job.CompletedAt,
|
||||
UpdatedAt: database.Now(),
|
||||
Error: job.Error,
|
||||
ErrorCode: job.ErrorCode,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("update provisioner job: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user