Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / remoting / protocol / errors.cc
blob9c92e54d139f63909b39383db0bf5bf39e4bedd6
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "remoting/protocol/errors.h"
7 #include "base/logging.h"
9 namespace remoting {
10 namespace protocol {
12 #define RETURN_STRING_LITERAL(x) \
13 case x: \
14 return #x;
16 const char* ErrorCodeToString(ErrorCode error) {
17 switch (error) {
18 RETURN_STRING_LITERAL(OK);
19 RETURN_STRING_LITERAL(PEER_IS_OFFLINE);
20 RETURN_STRING_LITERAL(SESSION_REJECTED);
21 RETURN_STRING_LITERAL(INCOMPATIBLE_PROTOCOL);
22 RETURN_STRING_LITERAL(AUTHENTICATION_FAILED);
23 RETURN_STRING_LITERAL(CHANNEL_CONNECTION_ERROR);
24 RETURN_STRING_LITERAL(SIGNALING_ERROR);
25 RETURN_STRING_LITERAL(SIGNALING_TIMEOUT);
26 RETURN_STRING_LITERAL(HOST_OVERLOAD);
27 RETURN_STRING_LITERAL(UNKNOWN_ERROR);
29 NOTREACHED();
30 return nullptr;
33 } // namespace protocol
34 } // namespace remoting