Skip to content

Commit

Permalink
fix(AsyncLoader): log exceptions
Browse files Browse the repository at this point in the history
Exceptions were being returned in the responses but not logged on the server.
  • Loading branch information
abyrd committed Nov 27, 2018
1 parent e00f3a9 commit b63fc47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/conveyal/r5/util/AsyncLoader.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.conveyal.r5.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
Expand Down Expand Up @@ -32,6 +35,8 @@
*/
public abstract class AsyncLoader<K,V> {

private static final Logger LOG = LoggerFactory.getLogger(AsyncLoader.class);

/**
* This map holds a loading progress object for each key, which will contain the requested object when complete.
*/
Expand Down Expand Up @@ -120,6 +125,7 @@ public LoaderState<V> get (K key) {
}
} catch (Exception ex) {
setError(key, ex);
LOG.error(ExceptionUtils.asString(ex));
}
});
}
Expand Down

0 comments on commit b63fc47

Please sign in to comment.