protected void error(Exception e, bool doThow = true) { if (OnError != null) { OnError.DynamicInvoke(this, e); } if (doThow) { throw e; } }