mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
For the love of god, wrap errors!
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
This commit is contained in:
@ -2061,13 +2061,13 @@ func (q *querier) GetProvisionerJobByID(ctx context.Context, id uuid.UUID) (data
|
||||
// can read the job.
|
||||
_, err := q.GetWorkspaceBuildByJobID(ctx, id)
|
||||
if err != nil {
|
||||
return database.ProvisionerJob{}, err
|
||||
return database.ProvisionerJob{}, xerrors.Errorf("fetch related workspace build: %w", err)
|
||||
}
|
||||
case database.ProvisionerJobTypeTemplateVersionDryRun, database.ProvisionerJobTypeTemplateVersionImport:
|
||||
// Authorized call to get template version.
|
||||
_, err := authorizedTemplateVersionFromJob(ctx, q, job)
|
||||
if err != nil {
|
||||
return database.ProvisionerJob{}, err
|
||||
return database.ProvisionerJob{}, xerrors.Errorf("fetch related template version: %w", err)
|
||||
}
|
||||
default:
|
||||
return database.ProvisionerJob{}, xerrors.Errorf("unknown job type: %q", job.Type)
|
||||
|
Reference in New Issue
Block a user