public void Intercept(IInvocation invocation) { try { invocation.Proceed(); } catch (Exception e) { _logger.ErrorFormat(e, "Error invoking {0}.{1}", invocation.TargetType.Name, invocation.Method.Name); var filename = _filename + "_" + DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss") + ".html"; try { _domCapture.CaptureDom(filename); } catch (Exception ex) { _logger.Error("Error saving a DOM", ex); } if (e is SelenoReceivedException) { throw; } throw new SelenoReceivedException(e); } }