|
@@ -158,12 +158,22 @@ class NodeMachine
|
|
@Override
|
|
@Override
|
|
public void run( )
|
|
public void run( )
|
|
{
|
|
{
|
|
- writeNodeStatus();
|
|
|
|
- readNodeStatuses();
|
|
|
|
- purgeOutdatedNodes();
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ writeNodeStatus();
|
|
|
|
+ readNodeStatuses();
|
|
|
|
+ purgeOutdatedNodes();
|
|
|
|
+ lastError = null;
|
|
|
|
+ }
|
|
|
|
+ catch ( final PwmUnrecoverableException e )
|
|
|
|
+ {
|
|
|
|
+ lastError = e.getErrorInformation();
|
|
|
|
+ LOGGER.error( e.getErrorInformation() );
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
void writeNodeStatus( )
|
|
void writeNodeStatus( )
|
|
|
|
+ throws PwmUnrecoverableException
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -175,12 +185,12 @@ class NodeMachine
|
|
{
|
|
{
|
|
final String errorMsg = "error writing node service heartbeat: " + e.getMessage();
|
|
final String errorMsg = "error writing node service heartbeat: " + e.getMessage();
|
|
final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_NODE_SERVICE_ERROR, errorMsg );
|
|
final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_NODE_SERVICE_ERROR, errorMsg );
|
|
- lastError = errorInformation;
|
|
|
|
- LOGGER.error( lastError );
|
|
|
|
|
|
+ throw new PwmUnrecoverableException( errorInformation );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void readNodeStatuses( )
|
|
void readNodeStatuses( )
|
|
|
|
+ throws PwmUnrecoverableException
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -192,12 +202,12 @@ class NodeMachine
|
|
{
|
|
{
|
|
final String errorMsg = "error reading node statuses: " + e.getMessage();
|
|
final String errorMsg = "error reading node statuses: " + e.getMessage();
|
|
final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_NODE_SERVICE_ERROR, errorMsg );
|
|
final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_NODE_SERVICE_ERROR, errorMsg );
|
|
- lastError = errorInformation;
|
|
|
|
- LOGGER.error( lastError );
|
|
|
|
|
|
+ throw new PwmUnrecoverableException( errorInformation );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void purgeOutdatedNodes( )
|
|
void purgeOutdatedNodes( )
|
|
|
|
+ throws PwmUnrecoverableException
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -208,8 +218,7 @@ class NodeMachine
|
|
{
|
|
{
|
|
final String errorMsg = "error purging outdated node reference: " + e.getMessage();
|
|
final String errorMsg = "error purging outdated node reference: " + e.getMessage();
|
|
final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_NODE_SERVICE_ERROR, errorMsg );
|
|
final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_NODE_SERVICE_ERROR, errorMsg );
|
|
- lastError = errorInformation;
|
|
|
|
- LOGGER.error( lastError );
|
|
|
|
|
|
+ throw new PwmUnrecoverableException( errorInformation );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|