File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -9,19 +9,22 @@ class Base
9
9
::Errno ::ENOENT ,
10
10
::Racc ::ParseError ,
11
11
::RubyParser ::SyntaxError ,
12
- ]
12
+ ::RuntimeError ,
13
+ ] . freeze
13
14
14
15
def initialize ( engine_config :)
15
16
@engine_config = engine_config
16
17
end
17
18
18
19
def run ( file )
19
20
process_file ( file )
20
- rescue *RESCUABLE_ERRORS => ex
21
- $stderr. puts ( "Skipping file #{ file } due to exception (#{ ex . class } ): #{ ex . message } \n #{ ex . backtrace . join ( "\n " ) } " )
22
21
rescue => ex
23
- $stderr. puts ( "#{ ex . class } error occurred processing file #{ file } : aborting." )
24
- raise ex
22
+ if RESCUABLE_ERRORS . map { |klass | ex . instance_of? ( klass ) } . include? ( true )
23
+ $stderr. puts ( "Skipping file #{ file } due to exception (#{ ex . class } ): #{ ex . message } \n #{ ex . backtrace . join ( "\n " ) } " )
24
+ else
25
+ $stderr. puts ( "#{ ex . class } error occurred processing file #{ file } : aborting." )
26
+ raise ex
27
+ end
25
28
end
26
29
27
30
def files
You can’t perform that action at this time.
0 commit comments