Improved Close Message description

This commit is contained in:
Brandon Smith
2015-09-23 15:36:58 -03:00
parent 535b513121
commit 539d8eff74

View File

@@ -85,7 +85,8 @@ namespace Discord.Net.WebSockets
}
if (result.MessageType == WebSocketMessageType.Close)
throw new Exception($"Got Close Message ({result.CloseStatus?.ToString() ?? "Unexpected"}): {result.CloseStatusDescription ?? "No Reason"}");
throw new Exception($"Got Close Message ({result.CloseStatus?.ToString() ?? "Unexpected"}): " +
result.CloseStatusDescription != "" ? result.CloseStatusDescription : "No Reason");
else
builder.Append(Encoding.UTF8.GetString(buffer.Array, buffer.Offset, result.Count));