Handle command errors
This commit is contained in:
@@ -34,13 +34,17 @@
|
|||||||
const result = ref("");
|
const result = ref("");
|
||||||
|
|
||||||
const sendCommand = async () => {
|
const sendCommand = async () => {
|
||||||
|
try{
|
||||||
const response = await useTauriShellCommand.create("exec-sh", [
|
const response = await useTauriShellCommand.create("exec-sh", [
|
||||||
"-c",
|
"-c",
|
||||||
input.value
|
input.value
|
||||||
]).execute();
|
]).execute();
|
||||||
|
|
||||||
result.value = JSON.stringify(response, null, 4);
|
result.value = JSON.stringify(response, null, 4);
|
||||||
|
}catch(error){
|
||||||
|
result.value = JSON.stringify(error, null, 4);
|
||||||
|
}finally{
|
||||||
input.value = "";
|
input.value = "";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user