summaryrefslogtreecommitdiff
path: root/tools/sapi_voice.vbs
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-11-11 08:31:37 +0000
committerJens Arnold <amiconn@rockbox.org>2007-11-11 08:31:37 +0000
commit69f0da7b402f6dbe3404c10e8804b904d6f2339b (patch)
tree7bd6b00e865bc1782cde787c999f19ad74d5027b /tools/sapi_voice.vbs
parent28dfb54eeb77b1c99972b3b5fa9f1d1fd97e04e4 (diff)
downloadrockbox-69f0da7b402f6dbe3404c10e8804b904d6f2339b.zip
rockbox-69f0da7b402f6dbe3404c10e8804b904d6f2339b.tar.gz
rockbox-69f0da7b402f6dbe3404c10e8804b904d6f2339b.tar.bz2
rockbox-69f0da7b402f6dbe3404c10e8804b904d6f2339b.tar.xz
Add error handling to the vbscript's EXEC method, so we get more meaningful info if a required command like 'lame' is missing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15568 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/sapi_voice.vbs')
-rwxr-xr-xtools/sapi_voice.vbs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/sapi_voice.vbs b/tools/sapi_voice.vbs
index a232b6f..c29b581 100755
--- a/tools/sapi_voice.vbs
+++ b/tools/sapi_voice.vbs
@@ -169,6 +169,17 @@ Do
Case "EXEC"
If bVerbose Then WScript.StdErr.WriteLine "> " & aLine(1)
oShell.Run aLine(1), 0, true
+ If Err.Number <> 0 Then
+ If Not bVerbose Then
+ WScript.StdErr.Write "> " & aLine(1) & ": "
+ End If
+ If Err.Number = &H80070002 Then ' Actually file not found
+ WScript.StdErr.WriteLine "command not found"
+ Else
+ WScript.StdErr.WriteLine Err.Description
+ End If
+ WScript.Quit 2
+ End If
Case "SYNC"
If bVerbose Then WScript.StdErr.WriteLine "Syncing"
WScript.StdOut.WriteLine aLine(1) ' Just echo what was passed