Browse Source

Improved Close Message description

tags/docs-0.9
Brandon Smith 9 years ago
parent
commit
539d8eff74
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs

+ 2
- 1
src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs 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));



Loading…
Cancel
Save