public override T ProcessMessage(IMessage message) { try { var result = _invocableHandlerMethod.Invoke(message); #pragma warning disable S2219 // Runtime type checking should be simplified if (result != null && typeof(T).IsAssignableFrom(result.GetType())) #pragma warning restore S2219 // Runtime type checking should be simplified { return((T)ConversionService.Convert(result, result?.GetType(), typeof(T))); } else { return((T)result); } } catch (Exception e) { throw new MessageHandlingException(message, e); } }
protected override object HandleRequestMessage(IMessage requestMessage) { try { // TODO: Look at async task type methods var result = _invocableHandlerMethod.Invoke(requestMessage); return(result); } catch (Exception e) { if (e is MessagingException) { throw; } else { throw new MessagingException( requestMessage, "Exception thrown while invoking " + _invocableHandlerMethod.ShortLogMessage, e); } } }