Use generics for incoming message error handling