Method
Try
(Func<T> action, Func<Exception, T> onError, Func<bool> isEOF)
Source from the content-addressed store, hash-verified
| 166 | } |
| 167 | |
| 168 | private static T Try<T>(Func<T> action, Func<Exception, T> onError, Func<bool> isEOF) |
| 169 | { |
| 170 | try |
| 171 | { |
| 172 | return action(); |
| 173 | } |
| 174 | catch (Exception e) |
| 175 | { |
| 176 | if (isEOF()) |
| 177 | return onError(e); |
| 178 | else |
| 179 | throw e; |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | // throws exceptions if xml is invalid |
| 184 | private static IEnumerable<XElement> StreamElements(this XmlReader reader) |
Callers
nothing calls this directly
Tested by
no test coverage detected