MCPcopy Create free account
hub / github.com/apple/foundationdb / Try

Method Try

contrib/TraceLogHelper/XmlParser.cs:168–181  ·  view source on GitHub ↗
(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

Calls 2

actionFunction · 0.85
onErrorFunction · 0.85

Tested by

no test coverage detected