}
public static RuntimeException wrapFDBException(Session session, Exception e)
{
if (isFromInterruption(e)) {
return new QueryCanceledException(session);
} else if (e instanceof FDBException) {
FDBException fdbEx = (FDBException)e;
switch (fdbEx.getCode()) {
case 1007: // past_version
return new FDBPastVersionException(fdbEx);