227 {
228 switch (code) {
229 case normal:
230 return "Normal close";
231 case going_away:
232 return "Going away";
233 case protocol_error:
234 return "Protocol error";
235 case unsupported_data:
236 return "Unsupported data";
237 case no_status:
238 return "No status set";
239 case abnormal_close:
240 return "Abnormal close";
241 case invalid_payload:
242 return "Invalid payload";
243 case policy_violation:
244 return "Policy violoation";
245 case message_too_big:
246 return "Message too big";
247 case extension_required:
248 return "Extension required";
249 case internal_endpoint_error:
250 return "Internal endpoint error";
251 case tls_handshake:
252 return "TLS handshake failure";
253 case subprotocol_error:
254 return "Generic subprotocol error";
255 case invalid_subprotocol_data:
256 return "Invalid subprotocol data";
257 default:
258 return "Unknown";
259 }
260 }