Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rfe9338: Improve error message due to session port connection failure

Added error message to refer to documentation url on franz.com.

The error message is unfortunately vague because other
causes are possible.

tests run:      prepush
tests added:    none, must be tested manually, requires remote server
performance:    no impact

<release-note>
rfe9338: Improve error message due to session port connection failure

When using method that start a session (setAutoCommit, addRules, and
registerSNAGenerator), if there is a connection error, give message
to point to the documentation about SessionPorts.
</release-note>

Change-Id: I2fe0979d2c83a3bad01a63aab70b56f76eef0927
Reviewed-on: https://gerrit.franz.com:9080/1163
Reviewed-by: John O'Rourke <john.orourke@franz.com>
Reviewed-by: Ahmon Dancy <dancy@franz.com>
Tested-by: Kevin Layer <layer@franz.com>
  • Loading branch information...
commit 436fb2ff39bfb5b91a2c21ab77670fb58dba001c 1 parent eb9c973
@mikehinchey mikehinchey authored dklayer committed
Showing with 16 additions and 4 deletions.
  1. +16 −4 src/com/franz/agraph/http/AGHttpRepoClient.java
View
20 src/com/franz/agraph/http/AGHttpRepoClient.java
@@ -1,5 +1,5 @@
/******************************************************************************
-** Copyright (c) 2008-2010 Franz Inc.
+** Copyright (c) 2008-2011 Franz Inc.
** All rights reserved. This program and the accompanying materials
** are made available under the terms of the Eclipse Public License v1.0
** which accompanies this distribution, and is available at
@@ -342,7 +342,19 @@ public void setAutoCommit(boolean autoCommit) throws RepositoryException {
} catch (RDFParseException e) {
throw new RepositoryException(e);
} catch (IOException e) {
- throw new RepositoryException(e);
+ throw handleSessionConnectionError(e, url);
+ }
+ }
+
+ private RepositoryException handleSessionConnectionError(IOException e, String url) throws RepositoryException {
+ if (e instanceof java.net.ConnectException) {
+ // To test this exception, setup remote server and only open port to
+ // the main port, not the SessionPorts and run TutorialTest.example6()
+ return new RepositoryException("Session port connection failure. Consult the Server Installation document for correct settings for SessionPorts. Url: " + url
+ + ". Documentation: http://www.franz.com/agraph/support/documentation/v4/server-installation.html#sessionport", e);
+ } else {
+ return new RepositoryException("Possible session port connection failure. Consult the Server Installation document for correct settings for SessionPorts. Url: " + url
+ + ". Documentation: http://www.franz.com/agraph/support/documentation/v4/server-installation.html#sessionport", e);
}
}
@@ -1154,7 +1166,7 @@ public void addRules(InputStream rulestream) throws RepositoryException {
} catch (RDFParseException e) {
throw new RepositoryException(e);
} catch (IOException e) {
- throw new RepositoryException(e);
+ throw handleSessionConnectionError(e, url);
}
}
@@ -1437,7 +1449,7 @@ public void registerSNAGenerator(String generator, List<String> objectOfs, List<
} catch (HttpException e) {
throw new RepositoryException(e);
} catch (IOException e) {
- throw new RepositoryException(e);
+ throw handleSessionConnectionError(e, url);
} catch (AGHttpException e) {
throw new RepositoryException(e);
} // TODO: need an RDFParseException for query param?
Please sign in to comment.
Something went wrong with that request. Please try again.