Removed ErrorException handling and shifted to passing the context array by reference to event dispatching.