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

◆ SetException()

void System.Net.FtpWebRequest.SetException ( Exception exception)
inlineprivate

Definition at line 1018 of file FtpWebRequest.cs.

1019 {
1020 if (System.Net.NetEventSource.Log.IsEnabled())
1021 {
1022 System.Net.NetEventSource.Info(this, null, "SetException");
1023 }
1024 if (exception is OutOfMemoryException)
1025 {
1027 throw exception;
1028 }
1029 FtpControlStream connection = _connection;
1030 if (_exception == null)
1031 {
1032 if (exception is WebException)
1033 {
1035 _exception = new WebException(exception.Message, null, ((WebException)exception).Status, _ftpWebResponse);
1036 }
1038 {
1040 }
1041 else if (connection != null && connection.StatusCode != 0)
1042 {
1044 _exception = new WebException(System.SR.Format(System.SR.net_ftp_servererror, connection.StatusLine), exception, WebExceptionStatus.ProtocolError, _ftpWebResponse);
1045 }
1046 else
1047 {
1048 _exception = new WebException(exception.Message, exception);
1049 }
1050 if (connection != null && _ftpWebResponse != null)
1051 {
1052 _ftpWebResponse.UpdateStatus(connection.StatusCode, connection.StatusLine, connection.ExitMessage);
1053 }
1054 }
1055 }
FtpControlStream _connection
FtpWebResponse _ftpWebResponse
void EnsureFtpWebResponse(Exception exception)
void UpdateStatus(FtpStatusCode statusCode, string statusLine, string exitMessage)
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_ftp_servererror
Definition SR.cs:82
Definition SR.cs:7

References System.exception, System.Net.FtpControlStream.ExitMessage, System.SR.Format(), System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, System.SR.net_ftp_servererror, System.Net.FtpControlStream.StatusCode, System.Net.FtpControlStream.StatusLine, and System.Net.FtpWebResponse.UpdateStatus().

Referenced by System.Net.FtpWebRequest.GetResponse(), and System.Net.FtpWebRequest.SubmitRequest().