Permalink
Browse files

use try catch to catch exception of error openning camera

  • Loading branch information...
aleen42 committed Apr 15, 2016
1 parent 77c7a64 commit 8f69f3e5fa089f8782a056b9edf62cf8a38383f1
Showing with 11 additions and 2 deletions.
  1. +9 −1 example/webcam.sh
  2. +2 −1 package.json
@@ -1,4 +1,12 @@
while true; do
streamer -f jpeg -o out.jpeg -q
{
# try block
streamer -f jpeg -o out.jpeg -q
} || {
# catch block
echo "[Error: failed to open video camera!]"
exit 1
}
node webcam.js
done
@@ -23,7 +23,8 @@
"contributors": [
"Eric Baer <me@ericbaer.com>",
"ComFreek <comfreek@outlook.com>",
"Szabo Cristian"
"Szabo Cristian",
"Aleen <aleen42@vip.qq.com>"
],
"license": "MIT",
"bugs": {

0 comments on commit 8f69f3e

Please sign in to comment.