Exemplo n.º 1
0
		private void CreateAndProcessRescueController(RescueDescriptor desc, Exception actionException)
		{
			IController rescueController = engineContext.Services.ControllerFactory.CreateController(desc.RescueController);

			ControllerMetaDescriptor rescueControllerMeta =
				engineContext.Services.ControllerDescriptorProvider.BuildDescriptor(rescueController);

			ControllerDescriptor rescueControllerDesc = rescueControllerMeta.ControllerDescriptor;

			IControllerContext rescueControllerContext = engineContext.Services.ControllerContextFactory.Create(
				rescueControllerDesc.Area, rescueControllerDesc.Name, desc.RescueMethod.Name,
				rescueControllerMeta);

			rescueControllerContext.CustomActionParameters["exception"] = actionException;
			rescueControllerContext.CustomActionParameters["controller"] = this;
			rescueControllerContext.CustomActionParameters["controllerContext"] = ControllerContext;

			rescueController.Process(engineContext, rescueControllerContext);
		}