This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Commit 6715ad1
committed
Catch RuntimeError when parsing
RubyParser raises `RuntimeError` instead of anything more specific in
certain parse error contexts.
This presents a challenge for catching these, since many error types
(including `Timeout::Error`, which we don't want to catch) inherit from
`RuntimeError`. So I've had to shift from two `rescue` clauses to one
`rescue` clause that uses internal logic to decide if the error should
be re-raised.1 parent 21899c6 commit 6715ad1
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | | - | |
22 | 21 | | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
0 commit comments