From 182459edbcfa9b20ad599b6d6e7ef901adba20a7 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Mon, 7 Jan 2019 16:53:30 +0100 Subject: [PATCH] Controller and method name in TopologyConfigurationException --- Tapeti/Default/MessageBinding.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tapeti/Default/MessageBinding.cs b/Tapeti/Default/MessageBinding.cs index f21cd6b..3f86b21 100644 --- a/Tapeti/Default/MessageBinding.cs +++ b/Tapeti/Default/MessageBinding.cs @@ -8,11 +8,11 @@ namespace Tapeti.Default public void Handle(IBindingContext context, Action next) { if (context.Parameters.Count == 0) - throw new TopologyConfigurationException("First parameter must be a message class"); + throw new TopologyConfigurationException($"First parameter of method {context.Method.Name} in controller {context.Method.DeclaringType?.Name} must be a message class"); var parameter = context.Parameters[0]; if (!parameter.Info.ParameterType.IsClass) - throw new TopologyConfigurationException($"First parameter {parameter.Info.Name} must be a message class"); + throw new TopologyConfigurationException($"First parameter {parameter.Info.Name} of method {context.Method.Name} in controller {context.Method.DeclaringType?.Name} must be a message class"); parameter.SetBinding(messageContext => messageContext.Message); context.MessageClass = parameter.Info.ParameterType;