Skip to content

Commit af8c4f6

Browse files
bewMartin Verzilli
authored and
Martin Verzilli
committedSep 16, 2017
Remove backtrace from ECR errors
Rescure only Errno::ENOENT & Errno::EISDIR errors, as thoses are the most common errors in this case.
1 parent 9965a9b commit af8c4f6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
 

Diff for: ‎src/ecr/process.cr

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
11
require "ecr/processor"
2-
puts ECR.process_file(ARGV[0], ARGV[1])
2+
3+
filename = ARGV[0]
4+
buffer_name = ARGV[1]
5+
6+
begin
7+
puts ECR.process_file(filename, buffer_name)
8+
rescue ex : Errno
9+
if {Errno::ENOENT, Errno::EISDIR}.includes?(ex.errno)
10+
STDERR.puts ex.message
11+
exit 1
12+
else
13+
raise ex
14+
end
15+
end

0 commit comments

Comments
 (0)
Please sign in to comment.