Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revised exception message of InconsistentApplicationException (#210).

  • Loading branch information...
commit 76f93e3ce5a37d391e79a551f75862e9d49f7127 1 parent 6225326
@akirakw akirakw authored
View
19 core-project/asakusa-runtime/src/main/java/com/asakusafw/runtime/core/context/RuntimeContext.java
@@ -365,11 +365,12 @@ private boolean verifyBuildId(URL url, Properties properties) {
} else {
throw new InconsistentApplicationException(MessageFormat.format(
"Inconsistent application, please check your deployed application: "
- + "url=\"{0}\", batchId=\"{1}\", expected=\"{2}\", actual=\"{3}\"",
+ + "url=\"{0}\", batchId=\"{1}\", caller=\"{2}\", callee=\"{3}\", hostname=\"{4}\"",
url,
batchId,
buildId,
- targetBuildId));
+ targetBuildId,
+ getHostName()));
}
}
@@ -394,11 +395,12 @@ private void verifyRuntime(URL url, Properties properties) {
} else {
throw new InconsistentApplicationException(MessageFormat.format(
"Inconsistent runtime version, please check your deployed framework: "
- + "url=\"{0}\", batchId=\"{1}\", expected=\"{2}\", actual=\"{3}\"",
+ + "url=\"{0}\", batchId=\"{1}\", caller=\"{2}\", callee=\"{3}\", hostname=\"{4}\"",
url,
batchId,
BatchRuntime.getLabel(),
- runtimeVersion));
+ runtimeVersion,
+ getHostName()));
}
}
@@ -421,6 +423,15 @@ private String normalize(String value) {
return trimmed;
}
+ private String getHostName() {
+ String hostname = System.getenv("HOSTNAME");
+ if (hostname == null) {
+ hostname = System.getenv("SSH_CONNECTION");
+ }
+ return hostname;
+
+ }
+
@Override
public int hashCode() {
final int prime = 31;
Please sign in to comment.
Something went wrong with that request. Please try again.