Skip to content

Commit

Permalink
feat: only display the http code after the client error
Browse files Browse the repository at this point in the history
  • Loading branch information
Meng-20 committed Aug 22, 2024
1 parent 2ee38b3 commit 4876edc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion webui/src/components/Appliance/ComposeMemoryButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export default {
this.newMemoryCredentials.port
) {
this.partialSuccess =
"Note: Memory allocation succeeded but memory port assignment failed.";
"Memory allocation succeeded but memory port assignment failed (206)";
}
// Get the size of the new memory chunk to update the blade memory,
// The final allocated memory size may be changed by the compose memory algorithm, so it may not be the same with the input one
Expand Down
4 changes: 2 additions & 2 deletions webui/src/components/Stores/ApplianceStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const useApplianceStore = defineStore('appliance', {
if (axios.isAxiosError(error)) {
this.addApplianceError = error.message;
if (error.response) {
this.addApplianceError = error.response?.data.status.message + " (" + error.message + ")";
this.addApplianceError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down Expand Up @@ -101,7 +101,7 @@ export const useApplianceStore = defineStore('appliance', {
if (axios.isAxiosError(error)) {
this.deleteApplianceError = error.message;
if (error.response) {
this.deleteApplianceError = error.response?.data.status.message + " (" + error.message + ")";
this.deleteApplianceError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down
6 changes: 3 additions & 3 deletions webui/src/components/Stores/BladeMemoryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const useBladeMemoryStore = defineStore('bladeMemory', {
if (axios.isAxiosError(error)) {
this.composeMemoryError = error.message;
if (error.response) {
this.composeMemoryError = error.response?.data.status.message + " (" + error.message + ")";
this.composeMemoryError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand All @@ -91,7 +91,7 @@ export const useBladeMemoryStore = defineStore('bladeMemory', {
if (axios.isAxiosError(error)) {
this.assignOrUnassignMemoryError = error.message;
if (error.response) {
this.assignOrUnassignMemoryError = error.response?.data.status.message + " (" + error.message + ")";
this.assignOrUnassignMemoryError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down Expand Up @@ -120,7 +120,7 @@ export const useBladeMemoryStore = defineStore('bladeMemory', {
if (axios.isAxiosError(error)) {
this.freeMemoryError = error.message;
if (error.response) {
this.freeMemoryError = error.response?.data.status.message + " (" + error.message + ")";
this.freeMemoryError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down
6 changes: 3 additions & 3 deletions webui/src/components/Stores/BladeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const useBladeStore = defineStore('blade', {
if (axios.isAxiosError(error)) {
this.resyncBladeError = error.message;
if (error.response) {
this.resyncBladeError = error.response?.data.status.message + " (" + error.message + ")";
this.resyncBladeError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand All @@ -106,7 +106,7 @@ export const useBladeStore = defineStore('blade', {
if (axios.isAxiosError(error)) {
this.addBladeError = error.message;
if (error.response) {
this.addBladeError = error.response?.data.status.message + " (" + error.message + ")";
this.addBladeError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down Expand Up @@ -134,7 +134,7 @@ export const useBladeStore = defineStore('blade', {
if (axios.isAxiosError(error)) {
this.deleteBladeError = error.message;
if (error.response) {
this.deleteBladeError = error.response?.data.status.message + " (" + error.message + ")";
this.deleteBladeError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down
6 changes: 3 additions & 3 deletions webui/src/components/Stores/HostStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const useHostStore = defineStore('host', {
if (axios.isAxiosError(error)) {
this.addHostError = error.message;
if (error.response) {
this.addHostError = error.response?.data.status.message + " (" + error.message + ")";
this.addHostError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down Expand Up @@ -91,7 +91,7 @@ export const useHostStore = defineStore('host', {
if (axios.isAxiosError(error)) {
this.deleteHostError = error.message;
if (error.response) {
this.deleteHostError = error.response?.data.status.message + " (" + error.message + ")";
this.deleteHostError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand All @@ -113,7 +113,7 @@ export const useHostStore = defineStore('host', {
if (axios.isAxiosError(error)) {
this.resyncHostError = error.message;
if (error.response) {
this.resyncHostError = error.response?.data.status.message + " (" + error.message + ")";
this.resyncHostError = error.response?.data.status.message + " (" + error.response?.request.status + ")";
}
}
else {
Expand Down

0 comments on commit 4876edc

Please sign in to comment.