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