File: errors.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (78 lines) | stat: -rw-r--r-- 2,523 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_BASE_ERRORS_H_
#define REMOTING_BASE_ERRORS_H_

#include <string>

namespace remoting {

// Workaround a dependency issue with management_ui_handler_unittest.cc, which
// includes chrome/browser/ash without checking the platform.
namespace proto {
enum ErrorCode : int;
}  // namespace proto

// If this enum is modified, please also modify the enums in these file:
// * chrome/browser/ash/policy/remote_commands/crd/public/crd_session_result_codes.h:
//     ExtendedStartCrdSessionResultCode
// * chrome/browser/ash/policy/remote_commands/crd/public/crd_session_result_codes.cc:
//     ToExtendedStartCrdSessionResultCode, ToStartCrdSessionResultCode
// * remoting/base/errors.cc: kErrorCodeNames
// * remoting/host/mojom/desktop_session.mojom: ProtocolErrorCode
// * remoting/host/mojom/remoting_mojom_traits.h:
//     EnumTraits<remoting::mojom::ProtocolErrorCode,
//                ::remoting::protocol::ErrorCode>
// * tools/metrics/histograms/metadata/enterprise/enums.xml:
//     EnterpriseCrdSessionResultCode
//
// DO NOT change existing values in this enum, since it would lead to version
// skew problems.
enum class ErrorCode {
  OK = 0,
  PEER_IS_OFFLINE = 1,
  SESSION_REJECTED = 2,
  INCOMPATIBLE_PROTOCOL = 3,
  AUTHENTICATION_FAILED = 4,
  INVALID_ACCOUNT = 5,
  CHANNEL_CONNECTION_ERROR = 6,
  SIGNALING_ERROR = 7,
  SIGNALING_TIMEOUT = 8,
  HOST_OVERLOAD = 9,
  MAX_SESSION_LENGTH = 10,
  HOST_CONFIGURATION_ERROR = 11,
  UNKNOWN_ERROR = 12,
  ELEVATION_ERROR = 13,
  HOST_CERTIFICATE_ERROR = 14,
  HOST_REGISTRATION_ERROR = 15,
  EXISTING_ADMIN_SESSION = 16,
  AUTHZ_POLICY_CHECK_FAILED = 17,
  DISALLOWED_BY_POLICY = 18,
  LOCATION_AUTHZ_POLICY_CHECK_FAILED = 19,
  UNAUTHORIZED_ACCOUNT = 20,
  REAUTHZ_POLICY_CHECK_FAILED = 21,
  NO_COMMON_AUTH_METHOD = 22,
  LOGIN_SCREEN_NOT_SUPPORTED = 23,
  SESSION_POLICIES_CHANGED = 24,
  UNEXPECTED_AUTHENTICATOR_ERROR = 25,
  INVALID_STATE = 26,
  INVALID_ARGUMENT = 27,
  NETWORK_FAILURE = 28,
  OPERATION_TIMEOUT = 29,

  ERROR_CODE_MAX = OPERATION_TIMEOUT,
};

bool ParseErrorCode(const std::string& name, ErrorCode* result);

// Returns the literal string of |error|.
const char* ErrorCodeToString(ErrorCode error);

// Converts a protocol ErrorCode to the protobuf ErrorCode.
proto::ErrorCode ErrorCodeToProtoEnum(ErrorCode error);

}  // namespace remoting

#endif  // REMOTING_BASE_ERRORS_H_