errors.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (c) 2012 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. #ifndef REMOTING_PROTOCOL_ERRORS_H_
  5. #define REMOTING_PROTOCOL_ERRORS_H_
  6. #include <string>
  7. namespace remoting {
  8. namespace protocol {
  9. // The UI implementations maintain corresponding definitions of this
  10. // enumeration in remoting/protocol/errors.cc and
  11. // android/java/src/org/chromium/chromoting/jni/ConnectionListener.java
  12. // Be sure to update these locations if you make any changes to the ordering.
  13. enum ErrorCode {
  14. OK = 0,
  15. PEER_IS_OFFLINE,
  16. SESSION_REJECTED,
  17. INCOMPATIBLE_PROTOCOL,
  18. AUTHENTICATION_FAILED,
  19. INVALID_ACCOUNT,
  20. CHANNEL_CONNECTION_ERROR,
  21. SIGNALING_ERROR,
  22. SIGNALING_TIMEOUT,
  23. HOST_OVERLOAD,
  24. MAX_SESSION_LENGTH,
  25. HOST_CONFIGURATION_ERROR,
  26. UNKNOWN_ERROR,
  27. ELEVATION_ERROR,
  28. HOST_CERTIFICATE_ERROR,
  29. HOST_REGISTRATION_ERROR,
  30. EXISTING_ADMIN_SESSION,
  31. AUTHZ_POLICY_CHECK_FAILED,
  32. DISALLOWED_BY_POLICY,
  33. LOCATION_AUTHZ_POLICY_CHECK_FAILED,
  34. ERROR_CODE_MAX = LOCATION_AUTHZ_POLICY_CHECK_FAILED,
  35. };
  36. bool ParseErrorCode(const std::string& name, ErrorCode* result);
  37. // Returns the literal string of |error|.
  38. const char* ErrorCodeToString(ErrorCode error);
  39. } // namespace protocol
  40. } // namespace remoting
  41. #endif // REMOTING_PROTOCOL_ERRORS_H_