Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ThrowEventSourceException()

void System.Diagnostics.Tracing.EventSource.ThrowEventSourceException ( string eventName,
Exception innerEx = null )
inlineprivateinherited

Definition at line 1726 of file EventSource.cs.

1727 {
1729 {
1730 return;
1731 }
1732 try
1733 {
1735 string text = "EventSourceException";
1736 if (eventName != null)
1737 {
1738 text = text + " while processing event \"" + eventName + "\"";
1739 }
1740 switch (EventProvider.GetLastWriteEventError())
1741 {
1742 case EventProvider.WriteEventErrorCode.EventTooBig:
1743 ReportOutOfBandMessage(text + ": " + SR.EventSource_EventTooBig);
1745 {
1746 throw new EventSourceException(SR.EventSource_EventTooBig, innerEx);
1747 }
1748 return;
1749 case EventProvider.WriteEventErrorCode.NoFreeBuffers:
1750 ReportOutOfBandMessage(text + ": " + SR.EventSource_NoFreeBuffers);
1752 {
1753 throw new EventSourceException(SR.EventSource_NoFreeBuffers, innerEx);
1754 }
1755 return;
1756 case EventProvider.WriteEventErrorCode.NullInput:
1757 ReportOutOfBandMessage(text + ": " + SR.EventSource_NullInput);
1759 {
1760 throw new EventSourceException(SR.EventSource_NullInput, innerEx);
1761 }
1762 return;
1763 case EventProvider.WriteEventErrorCode.TooManyArgs:
1764 ReportOutOfBandMessage(text + ": " + SR.EventSource_TooManyArgs);
1766 {
1767 throw new EventSourceException(SR.EventSource_TooManyArgs, innerEx);
1768 }
1769 return;
1770 }
1771 if (innerEx != null)
1772 {
1773 innerEx = innerEx.GetBaseException();
1774 ReportOutOfBandMessage(text + ": " + innerEx.GetType()?.ToString() + ":" + innerEx.Message);
1775 }
1776 else
1777 {
1779 }
1781 {
1782 throw new EventSourceException(innerEx);
1783 }
1784 }
1785 finally
1786 {
1788 }
1789 }

References System.SR.EventSource_EventTooBig, System.SR.EventSource_NoFreeBuffers, System.SR.EventSource_NullInput, System.SR.EventSource_TooManyArgs, System.Diagnostics.Tracing.EventProvider.GetLastWriteEventError(), System.Diagnostics.Tracing.EventSource.m_EventSourceExceptionRecurenceCount, System.Diagnostics.Tracing.EventSource.ReportOutOfBandMessage(), System.text, and System.Diagnostics.Tracing.EventSource.ThrowOnEventWriteErrors.

Referenced by System.Diagnostics.Tracing.EventSource.SendManifest(), System.Diagnostics.Tracing.EventSource.WriteEventRaw(), System.Diagnostics.Tracing.EventSource.WriteEventVarargs(), System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityIdCore(), and System.Diagnostics.Tracing.EventSource.WriteImpl().