public static void HandleError(Exception lastError) { Exception error = lastError.GetBaseException(); if (error is HttpException && ((HttpException)error).ErrorCode == 404) return; var sensor = new ExceptionSensor(); sensor.AddError(error); }