Permalink
Browse files

Fixes #3712, Do not keep looping on ENOENT or EINVAL

git-svn-id: file:///home/svn/framework3/trunk@11752 4d416f70-5f16-0410-b530-b9f4589650da
  • Loading branch information...
1 parent 257fe9d commit a27a545889f0dcb2ea83a0fab252bf14c07f6298 @jduck jduck committed Feb 15, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 msfencode
View
@@ -174,7 +174,7 @@ $args.parse(ARGV) { |opt, idx, val|
when "-h"
usage
-
+
when "-v"
verbose += 1
@@ -272,6 +272,14 @@ case cmd
exit
+ #
+ # These exception codes are fatal, we shouldn't expect them to succeed on the next
+ # iteration, nor the next encoder.
+ #
+ rescue ::Errno::ENOENT, ::Errno::EINVAL
+ $stderr.puts(OutError + "#{enc.refname} failed: #{$!}")
+ break
+
rescue => e
$stderr.puts(OutError + "#{enc.refname} failed: #{e}")
if verbose > 0

0 comments on commit a27a545

Please sign in to comment.