File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
azkarra-server/src/main/java/io/streamthoughts/azkarra/http/health/internal Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 30
30
31
31
import java .util .List ;
32
32
import java .util .Map ;
33
+ import java .util .Optional ;
33
34
import java .util .TreeMap ;
34
35
import java .util .stream .Collectors ;
35
36
@@ -75,13 +76,18 @@ public Health getHealth() {
75
76
76
77
private void setHealthStatus (final KafkaStreamsContainer container ,
77
78
final Health .Builder builder ) {
78
- State value = container .state ().value ();
79
+ final State value = container .state ().value ();
80
+ final Optional <Throwable > exception = container .exception ();
79
81
switch (value ) {
80
82
case RUNNING :
81
83
builder .up ();
82
- break ;
84
+ break ;
83
85
case ERROR :
84
86
builder .down ();
87
+ exception .ifPresent (builder ::withException );
88
+ break ;
89
+ case NOT_RUNNING :
90
+ exception .ifPresentOrElse (e -> builder .down ().withException (e ), builder ::unknown );
85
91
break ;
86
92
default :
87
93
builder .unknown ();
You can’t perform that action at this time.
0 commit comments