mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Update BE http errors to be ui friendly (#1994)
* chore: More UI friendly errors Mainly capitlization + messages prefix error
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ func autostartShow() *cobra.Command {
|
||||
validSchedule, err := schedule.Weekly(*workspace.AutostartSchedule)
|
||||
if err != nil {
|
||||
// This should never happen.
|
||||
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "invalid autostart schedule %q for workspace %s: %s\n", *workspace.AutostartSchedule, workspace.Name, err.Error())
|
||||
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "Invalid autostart schedule %q for workspace %s: %s\n", *workspace.AutostartSchedule, workspace.Name, err.Error())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ func TestAutostart(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
|
||||
})
|
||||
|
||||
t.Run("Disable_NotFound", func(t *testing.T) {
|
||||
@@ -125,7 +125,7 @@ func TestAutostart(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
|
||||
})
|
||||
|
||||
t.Run("Enable_DefaultSchedule", func(t *testing.T) {
|
||||
|
||||
+2
-2
@@ -149,7 +149,7 @@ func TestTTL(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
|
||||
})
|
||||
|
||||
t.Run("Unset_NotFound", func(t *testing.T) {
|
||||
@@ -166,6 +166,6 @@ func TestTTL(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user