Controller and method name in TopologyConfigurationException
This commit is contained in:
parent
4ab6f67ea6
commit
182459edbc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user