fix: improve codersdk error messages when not JSON (#4495)

This commit is contained in:
Dean Sheather
2022-10-22 09:36:31 +10:00
committed by GitHub
parent 7bc5b89f7a
commit d0fb054a55
4 changed files with 233 additions and 11 deletions

View File

@ -421,7 +421,7 @@ func (api *API) fetchTemplateVersionDryRunJob(rw http.ResponseWriter, r *http.Re
return database.ProvisionerJob{}, false
}
// Do a workspace resource check since it's basically a workspace dry-run .
// Do a workspace resource check since it's basically a workspace dry-run.
if !api.Authorize(r, rbac.ActionRead,
rbac.ResourceWorkspace.InOrg(templateVersion.OrganizationID).WithOwner(job.InitiatorID.String())) {
httpapi.Forbidden(rw)