public void Run() { try { SiDriverState currentState = StartupBootstrap(); while (IsAlive(currentState)) { GecoSiLogger.StateChanged(currentState.GetType().Name); currentState = currentState.Receive(messageQueue, writer, siHandler); } if (currentState.IsError()) { siHandler.NotifyError(CommStatus.FatalError, currentState.Status()); } } catch (ThreadInterruptedException e) { // normal way out } catch (Exception e) { e.PrintStackTrace(); GecoSiLogger.Error(" #run# " + e); } finally { Stop(); } }