Skip to content

Commit

Permalink
Remove backtrace from ECR errors
Browse files Browse the repository at this point in the history
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 af8c4f6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/ecr/process.cr
Original file line number Diff line number Diff line change
@@ -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.