OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "remoting/protocol/errors.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace remoting { |
| 10 namespace protocol { |
| 11 |
| 12 #define RETURN_STRING_LITERAL(x) \ |
| 13 case x: \ |
| 14 return #x; |
| 15 |
| 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); |
| 28 } |
| 29 NOTREACHED(); |
| 30 return nullptr; |
| 31 } |
| 32 |
| 33 } // namespace protocol |
| 34 } // namespace remoting |
OLD | NEW |