Event System and exceptions.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hello,
I'm raising an issue with that:

File: \nopcommerce\src\Libraries\Nop.Core\Events\EventPublisher.cs

        private static void PublishToConsumer<T>(IConsumer<T> x, T eventMessage)
        {
            try
            {
                x.HandleEvent(eventMessage);
            }
            catch (Exception)
            {
                //TODO:Log this some how. We can't reference the ILogger because the interface exists in another assembly. Maybe we can move all interfaces to Nop.Core and all the implemntes to Nop.Services?
            }
            finally
            {
                //TODO actually we should not dispose it
                var instance = x as IDisposable;
                if (instance != null)
                {
                    instance.Dispose();
                }
            }
        }
    }


It's like this for a while, and i think we really need a way to know if an event fails, since important stuff is done with Consumers in the Nop Codebase, if an unspotted bug make it into production it can cause serious problems!

So, the Event facilities resides in the Core assembly but the Logging facilities resides in the Services tier, and the PublishToConsumer is static.

Maybe we could move the IEventService and impl in the Services tier?

Possible solutions? Discuss?
11 years ago
M.Ang wrote:
Maybe we could move the IEventService and impl in the Services tier?

Hi Marco,

Yes. That can be a solution. I've just created a work item here
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.