File: errors.h

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (77 lines) | stat: -rw-r--r-- 2,495 bytes parent folder | download | duplicates (2)
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
// 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,

  ERROR_CODE_MAX = NETWORK_FAILURE,
};

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_