diff options
-rw-r--r-- | src/state/active_state.hpp | 6 | ||||
-rw-r--r-- | src/state/ready_state.hpp | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/state/active_state.hpp b/src/state/active_state.hpp index 766c105..a2a8653 100644 --- a/src/state/active_state.hpp +++ b/src/state/active_state.hpp @@ -83,6 +83,12 @@ struct ActiveState : public BasicStateT<ActiveState> std::move(gadget)); } + [[noreturn]] std::unique_ptr<BasicState> handleEvent(MountEvent event) + { + LogMsg(Logger::Error, "InvalidĀ event: ", event.eventName); + throw sdbusplus::exception::SdBusError(EPERM, "Operation not permitted in active state"); + } + template <class AnyEvent> [[noreturn]] std::unique_ptr<BasicState> handleEvent(AnyEvent event) { diff --git a/src/state/ready_state.hpp b/src/state/ready_state.hpp index 5edfa06..2243143 100644 --- a/src/state/ready_state.hpp +++ b/src/state/ready_state.hpp @@ -47,6 +47,12 @@ struct ReadyState : public BasicStateT<ReadyState> return std::make_unique<ActivatingState>(machine); } + [[noreturn]] std::unique_ptr<BasicState> handleEvent(UnmountEvent event) + { + LogMsg(Logger::Error, "InvalidĀ event: ", event.eventName); + throw sdbusplus::exception::SdBusError(EPERM, "Operation not permitted in ready state"); + } + template <class AnyEvent> std::unique_ptr<BasicState> handleEvent(AnyEvent event) { |