-
Notifications
You must be signed in to change notification settings - Fork 901
feat: propagate job error codes #6507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
b77747b
bfa9140
e41136e
55f46b7
77d7d7d
43e6b7a
ee381ab
20fe286
d782120
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,14 @@ const ( | |
ProvisionerJobFailed ProvisionerJobStatus = "failed" | ||
) | ||
|
||
// JobErrorCode defines the error code returned by job runner. | ||
type JobErrorCode string | ||
|
||
const ( | ||
MissingTemplateParameter JobErrorCode = "MISSING_TEMPLATE_PARAMETER" | ||
RequiredTemplateVariables JobErrorCode = "REQUIRED_TEMPLATE_VARIABLES" | ||
) | ||
|
||
// ProvisionerJob describes the job executed by the provisioning daemon. | ||
type ProvisionerJob struct { | ||
ID uuid.UUID `json:"id" format:"uuid"` | ||
|
@@ -75,7 +83,7 @@ type ProvisionerJob struct { | |
CompletedAt *time.Time `json:"completed_at,omitempty" format:"date-time"` | ||
CanceledAt *time.Time `json:"canceled_at,omitempty" format:"date-time"` | ||
Error string `json:"error,omitempty"` | ||
ErrorCode string `json:"error_code,omitempty"` | ||
ErrorCode JobErrorCode `json:"error_code,omitempty" enums:"MISSING_TEMPLATE_PARAMETER,REQUIRED_TEMPLATE_VARIABLES"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked it now - unfortunately, swaggo removed enum parts from the docs and |
||
Status ProvisionerJobStatus `json:"status" enums:"pending,running,succeeded,canceling,canceled,failed"` | ||
WorkerID *uuid.UUID `json:"worker_id,omitempty" format:"uuid"` | ||
FileID uuid.UUID `json:"file_id" format:"uuid"` | ||
|
Uh oh!
There was an error while loading. Please reload this page.