Skip to content

Commit

Permalink
Fix err message
Browse files Browse the repository at this point in the history
  • Loading branch information
momom-i committed Mar 12, 2022
1 parent 263396a commit 0ea96b1
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
10 changes: 5 additions & 5 deletions web/api/v1/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const applyNode = async (req: V1Node, onError: (_: string) => void) => {
const res = await createNode(req, onError);
return res;
}
onError("Caused by applyNode: " + e);
onError("failed to applyNode: " + e);
}
};

Expand All @@ -28,7 +28,7 @@ export const listNode = async (onError: (_: string) => void) => {
const res = await k8sInstance.get<V1NodeList>(`/nodes`, {});
return res.data;
} catch (e: any) {
onError("Caused by listNode: " + e);
onError("failed to listNode: " + e);
}
};

Expand All @@ -37,7 +37,7 @@ export const getNode = async (name: string, onError: (_: string) => void) => {
const res = await k8sInstance.get<V1Node>(`/nodes/${name}`, {});
return res.data;
} catch (e: any) {
onError("Caused by getNode: " + e);
onError("failed to getNode: " + e);
}
};

Expand All @@ -49,7 +49,7 @@ export const deleteNode = async (
const res = await k8sInstance.delete(`/nodes/${name}`, {});
return res.data;
} catch (e: any) {
onError("Caused by deleteNode: " + e);
onError("failed to deleteNode: " + e);
}
};

Expand All @@ -61,6 +61,6 @@ const createNode = async (req: V1Node, onError: (_: string) => void) => {
);
return res.data;
} catch (e: any) {
onError("Caused by createNode: " + e);
onError("failed to createNode: " + e);
}
};
10 changes: 5 additions & 5 deletions web/api/v1/pod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const applyPod = async (req: V1Pod, onError: (_: string) => void) => {
const res = await createPod(req, onError);
return res;
}
onError("Caused by applyPod: " + e);
onError("failed to applyPod: " + e);
}
};

Expand All @@ -28,7 +28,7 @@ export const listPod = async (onError: (_: string) => void) => {
const res = await k8sInstance.get<V1PodList>(namespaceURL + `/pods`, {});
return res.data;
} catch (e: any) {
onError("Caused by listPod: " + e);
onError("failed to listPod: " + e);
}
};

Expand All @@ -40,7 +40,7 @@ export const getPod = async (name: string, onError: (_: string) => void) => {
);
return res.data;
} catch (e: any) {
onError("Caused by getPod: " + e);
onError("failed to getPod: " + e);
}
};

Expand All @@ -52,7 +52,7 @@ export const deletePod = async (name: string, onError: (_: string) => void) => {
);
return res.data;
} catch (e: any) {
onError("Caused by deletePod: " + e);
onError("failed to deletePod: " + e);
}
};

Expand All @@ -64,6 +64,6 @@ const createPod = async (req: V1Pod, onError: (_: string) => void) => {
);
return res.data;
} catch (e: any) {
onError("Caused by createPod: " + e);
onError("failed to createPod: " + e);
}
};
10 changes: 5 additions & 5 deletions web/api/v1/priorityclass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const applyPriorityClass = async (
const res = await createPriorityClass(req, onError);
return res;
}
onError("Caused by applyPriorityClass: " + e);
onError("failed to applyPriorityClass: " + e);
}
};

Expand All @@ -34,7 +34,7 @@ export const listPriorityClass = async (onError: (_: string) => void) => {
);
return res.data;
} catch (e: any) {
onError("Caused by listPriorityClass: " + e);
onError("failed to listPriorityClass: " + e);
}
};

Expand All @@ -49,7 +49,7 @@ export const getPriorityClass = async (
);
return res.data;
} catch (e: any) {
onError("Caused by getPriorityClass: " + e);
onError("failed to getPriorityClass: " + e);
}
};

Expand All @@ -64,7 +64,7 @@ export const deletePriorityClass = async (
);
return res.data;
} catch (e: any) {
onError("Caused by deletePriorityClass: " + e);
onError("failed to deletePriorityClass: " + e);
}
};

Expand All @@ -79,6 +79,6 @@ const createPriorityClass = async (
);
return res.data;
} catch (e: any) {
onError("Caused by createPriorityClass: " + e);
onError("failed to createPriorityClass: " + e);
}
};
10 changes: 5 additions & 5 deletions web/api/v1/pv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const applyPersistentVolume = async (
const res = await createPersistentvolumes(req, onError);
return res;
}
onError("Caused by applyPersistentVolume: " + e);
onError("failed to applyPersistentVolume: " + e);
}
};

Expand All @@ -37,7 +37,7 @@ export const listPersistentVolume = async (onError: (_: string) => void) => {
);
return res.data;
} catch (e: any) {
onError("Caused by listPersistentVolume: " + e);
onError("failed to listPersistentVolume: " + e);
}
};

Expand All @@ -52,7 +52,7 @@ export const getPersistentVolume = async (
);
return res.data;
} catch (e: any) {
onError("Caused by getPersistentVolume: " + e);
onError("failed to getPersistentVolume: " + e);
}
};

Expand All @@ -64,7 +64,7 @@ export const deletePersistentVolume = async (
const res = await k8sInstance.delete(`/persistentvolumes/${name}`, {});
return res.data;
} catch (e: any) {
onError("Caused by deletePersistentVolume: " + e);
onError("failed to deletePersistentVolume: " + e);
}
};

Expand All @@ -79,6 +79,6 @@ const createPersistentvolumes = async (
);
return res.data;
} catch (e: any) {
onError("Caused by createPersistentvolumes: " + e);
onError("failed to createPersistentvolumes: " + e);
}
};
10 changes: 5 additions & 5 deletions web/api/v1/pvc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const applyPersistentVolumeClaim = async (
const res = await createPersistentVolumeClaim(req, onError);
return res;
}
onError("Caused by applyPersistentVolumeClaim: " + e);
onError("failed to applyPersistentVolumeClaim: " + e);
}
};

Expand All @@ -40,7 +40,7 @@ export const listPersistentVolumeClaim = async (
);
return res.data;
} catch (e: any) {
onError("Caused by listPersistentVolumeClaim: " + e);
onError("failed to listPersistentVolumeClaim: " + e);
}
};

Expand All @@ -55,7 +55,7 @@ export const getPersistentVolumeClaim = async (
);
return res.data;
} catch (e: any) {
onError("Caused by getPersistentVolumeClaim: " + e);
onError("failed to getPersistentVolumeClaim: " + e);
}
};

Expand All @@ -70,7 +70,7 @@ export const deletePersistentVolumeClaim = async (
);
return res.data;
} catch (e: any) {
onError("Caused by deletePersistentVolumeClaim: " + e);
onError("failed to deletePersistentVolumeClaim: " + e);
}
};

Expand All @@ -85,6 +85,6 @@ const createPersistentVolumeClaim = async (
);
return res.data;
} catch (e: any) {
onError("Caused by createPersistentVolumeClaim: " + e);
onError("failed to createPersistentVolumeClaim: " + e);
}
};
10 changes: 5 additions & 5 deletions web/api/v1/storageclass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const applyStorageClass = async (
const res = await createStorageClass(req, onError);
return res;
}
onError("Caused by applyStorageClass: " + e);
onError("failed to applyStorageClass: " + e);
}
};

Expand All @@ -34,7 +34,7 @@ export const listStorageClass = async (onError: (_: string) => void) => {
);
return res.data;
} catch (e: any) {
onError("Caused by listStorageClass: " + e);
onError("failed to listStorageClass: " + e);
}
};

Expand All @@ -49,7 +49,7 @@ export const getStorageClass = async (
);
return res.data;
} catch (e: any) {
onError("Caused by getStorageClass: " + e);
onError("failed to getStorageClass: " + e);
}
};

Expand All @@ -61,7 +61,7 @@ export const deleteStorageClass = async (
const res = await k8sStorageInstance.delete(`/storageclasses/${name}`, {});
return res.data;
} catch (e: any) {
onError("Caused by deleteStorageClass: " + e);
onError("failed to deleteStorageClass: " + e);
}
};

Expand All @@ -76,6 +76,6 @@ const createStorageClass = async (
);
return res.data;
} catch (e: any) {
onError("Caused by createStorageClass: " + e);
onError("failed to createStorageClass: " + e);
}
};

0 comments on commit 0ea96b1

Please sign in to comment.