Beispiel #1
0
 public static Config.Parser <From, B> flatMapTry <From, A, B>(
     this Config.Parser <From, A> aParser, Func <ConfigPath, A, B> f
     ) =>
 (path, o) => aParser(path, o).flatMapRight(a => {
     try { return(new Either <ConfigLookupError, B>(f(path, a))); }
     catch (ConfigFetchException e) { return(new Either <ConfigLookupError, B>(e.error)); }
     catch (Exception e) { return(new Either <ConfigLookupError, B>(ConfigLookupError.fromException(e))); }
 });