Problem in the Documentation code fixed.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/9fde8eec Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/9fde8eec Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/9fde8eec Branch: refs/heads/serialization-3.0 Commit: 9fde8eec856d572cfc78b1e957a47fddf95b3d08 Parents: 3dd4201 Author: niclas <[email protected]> Authored: Sat Feb 25 14:01:36 2017 +0800 Committer: niclas <[email protected]> Committed: Sat Feb 25 14:01:36 2017 +0800 ---------------------------------------------------------------------- .../apache/polygene/api/metrics/DocumentationSupport.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/9fde8eec/core/api/src/test/java/org/apache/polygene/api/metrics/DocumentationSupport.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/metrics/DocumentationSupport.java b/core/api/src/test/java/org/apache/polygene/api/metrics/DocumentationSupport.java index 78f9b43..005a5d2 100644 --- a/core/api/src/test/java/org/apache/polygene/api/metrics/DocumentationSupport.java +++ b/core/api/src/test/java/org/apache/polygene/api/metrics/DocumentationSupport.java @@ -66,7 +66,15 @@ public class DocumentationSupport MetricsHealthCheck healthCheck = healthFactory.registerHealthCheck( "Sample Healthcheck", () -> { ServiceStatus status = pingMyService(); - return new MetricsHealthCheck.Result( status.isOk(), status.getErrorMessage(), status.getException() ); + if( status.isOk() ) + return MetricsHealthCheck.Result.healthOk(); + String message = status.getErrorMessage(); + Exception error = status.getException(); + if( error != null ) + { + return MetricsHealthCheck.Result.exception(message, error); + } + return MetricsHealthCheck.Result.unhealthy(message); } ); // END SNIPPET: healthcheck
