| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/battor_agent/battor_error.h" | 5 #include "tools/battor_agent/battor_error.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace battor { | 9 namespace battor { |
| 10 | 10 |
| 11 std::string BattOrErrorToString(BattOrError error) { | 11 std::string BattOrErrorToString(BattOrError error) { |
| 12 switch (error) { | 12 switch (error) { |
| 13 case BATTOR_ERROR_NONE: | 13 case BATTOR_ERROR_NONE: |
| 14 return "NONE"; | 14 return "NONE"; |
| 15 case BATTOR_ERROR_CONNECTION_FAILED: | 15 case BATTOR_ERROR_CONNECTION_FAILED: |
| 16 return "CONNECTION FAILED"; | 16 return "CONNECTION FAILED"; |
| 17 case BATTOR_ERROR_TIMEOUT: | 17 case BATTOR_ERROR_TIMEOUT: |
| 18 return "TIMEOUT"; | 18 return "TIMEOUT"; |
| 19 case BATTOR_ERROR_SEND_ERROR: | 19 case BATTOR_ERROR_SEND_ERROR: |
| 20 return "SEND ERROR"; | 20 return "SEND ERROR"; |
| 21 case BATTOR_ERROR_RECEIVE_ERROR: | 21 case BATTOR_ERROR_RECEIVE_ERROR: |
| 22 return "RECEIVE ERROR"; | 22 return "RECEIVE ERROR"; |
| 23 case BATTOR_ERROR_UNEXPECTED_MESSAGE: | 23 case BATTOR_ERROR_UNEXPECTED_MESSAGE: |
| 24 return "UNEXPECTED MESSAGE"; | 24 return "UNEXPECTED MESSAGE"; |
| 25 case BATTOR_ERROR_TOO_MANY_INIT_RETRIES: |
| 26 return "TOO MANY INIT RETRIES"; |
| 25 } | 27 } |
| 26 | 28 |
| 27 NOTREACHED(); | 29 NOTREACHED(); |
| 28 return std::string(); | 30 return std::string(); |
| 29 } | 31 } |
| 30 | 32 |
| 31 } // namespace battor | 33 } // namespace battor |
| OLD | NEW |