- Notifications
You must be signed in to change notification settings - Fork1k
refactor: untangle workspace creation from http logic#19639
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM, one non-blocking suggestion that could be deferred
} | ||
typeresponseErrorstruct { | ||
statusint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
How about embedding or extendingcodersdk.Error
instead? It already has these fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm unsure about that for now,codersdk.Error
also contains a few extra fields such asmethod
url
andHelper
which I'm not sure make such sense given the context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Fair enough 👍
29a7313
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Coder Tasks requires us to create a workspace, but we want to be able to return a
codersdk.Task
instead of acodersdk.Workspace
. This requires untanglingcreateWorkspace
from directly writing tohttp.ResponseWriter
.