Skip to content
Permalink
Browse files
Remove backtrace from ECR errors
Rescure only Errno::ENOENT & Errno::EISDIR errors, as thoses are
the most common errors in this case.
  • Loading branch information
bew authored and Martin Verzilli committed Sep 16, 2017
1 parent 9965a9b commit af8c4f6866d24d21e45520c4e76a524712b2f026
Showing 1 changed file with 14 additions and 1 deletion.
@@ -1,2 +1,15 @@
require "ecr/processor"
puts ECR.process_file(ARGV[0], ARGV[1])

filename = ARGV[0]
buffer_name = ARGV[1]

begin
puts ECR.process_file(filename, buffer_name)
rescue ex : Errno
if {Errno::ENOENT, Errno::EISDIR}.includes?(ex.errno)
STDERR.puts ex.message
exit 1
else
raise ex
end
end

0 comments on commit af8c4f6

Please sign in to comment.