diff options
-rw-r--r-- | src/state/active_state.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/state/active_state.hpp b/src/state/active_state.hpp index 541e27e..766c105 100644 --- a/src/state/active_state.hpp +++ b/src/state/active_state.hpp @@ -45,7 +45,7 @@ struct ActiveState : public BasicStateT<ActiveState> // unmount media & stop retriggering timer boost::asio::spawn( machine.getIoc(), - [& machine = machine](boost::asio::yield_context yield) { + [&machine = machine](boost::asio::yield_context yield) { machine.emitUnmountEvent(); }); return; @@ -84,10 +84,11 @@ struct ActiveState : public BasicStateT<ActiveState> } template <class AnyEvent> - std::unique_ptr<BasicState> handleEvent(AnyEvent event) + [[noreturn]] std::unique_ptr<BasicState> handleEvent(AnyEvent event) { LogMsg(Logger::Error, "Invalid event: ", event.eventName); - return nullptr; + throw sdbusplus::exception::SdBusError( + EOPNOTSUPP, "Operation not supported in active state"); } private: |