Index: pkg/pool/lib/pool.dart |
diff --git a/pkg/pool/lib/pool.dart b/pkg/pool/lib/pool.dart |
index 36a29c86dca0951753d3bd7159a6f66f1f3dff4d..61482e3f2ba46944a6a3cd13c924d1fbdc77036a 100644 |
--- a/pkg/pool/lib/pool.dart |
+++ b/pkg/pool/lib/pool.dart |
@@ -40,14 +40,14 @@ class Pool { |
Timer _timer; |
/// The amount of time to wait before timing out the pending resources. |
- Duration _timeout; |
+ final Duration _timeout; |
/// Creates a new pool with the given limit on how many resources may be |
/// allocated at once. |
/// |
/// If [timeout] is passed, then if that much time passes without any activity |
- /// all pending [request] futures will throw an exception. This is indented |
- /// to avoid deadlocks. |
+ /// all pending [request] futures will throw a [TimeoutException]. This is |
+ /// intended to avoid deadlocks. |
Pool(this._maxAllocatedResources, {Duration timeout}) |
: _timeout = timeout; |
@@ -106,8 +106,11 @@ class Pool { |
/// emit exceptions. |
void _onTimeout() { |
for (var completer in _requestedResources) { |
- completer.completeError("Pool deadlock: all resources have been " |
- "allocated for too long.", new Chain.current()); |
+ completer.completeError( |
+ new TimeoutException("Pool deadlock: all resources have been " |
+ "allocated for too long.", |
+ _timeout), |
+ new Chain.current()); |
} |
_requestedResources.clear(); |
_timer = null; |