Browse files

add timeout info to the SqlQueryTimeoutException.

  • Loading branch information...
1 parent fbdc843 commit 108d8e4ccb45ff6c4adc60ee41a048f46d91459d Robey Pointer committed Sep 1, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/scala/com/twitter/querulous/query/TimingOutQuery.scala
View
4 src/main/scala/com/twitter/querulous/query/TimingOutQuery.scala
@@ -4,7 +4,7 @@ import java.sql.{SQLException, Connection}
import com.twitter.xrayspecs.Duration
-class SqlQueryTimeoutException extends SQLException("Query timeout")
+class SqlQueryTimeoutException(val timeout: Duration) extends SQLException("Query timeout: " + timeout.inMillis + " msec")
/**
* A {@code QueryFactory} that creates {@link Query}s that execute subject to a {@code timeout}. An
@@ -52,7 +52,7 @@ class TimingOutQuery(query: Query, timeout: Duration) extends QueryProxy(query)
}
} catch {
case e: TimeoutException =>
- throw new SqlQueryTimeoutException
+ throw new SqlQueryTimeoutException(timeout)
}
}
}

0 comments on commit 108d8e4

Please sign in to comment.