Intel® Collaboration Suite for WebRTC  version 4.3.1
Open WebRTC Toolkit (OWT) Client SDK for Windows*
exception.h
1 // Copyright (C) <2018> Intel Corporation
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 #ifndef OWT_BASE_EXCEPTION_H_
5 #define OWT_BASE_EXCEPTION_H_
6 #include <string>
7 namespace owt {
8 namespace base{
9 // TODO: The following exceptions need to sync with other SDKs
10 enum class ExceptionType : int {
11  kUnknown = 1000, // General exception
12  // kLocal* for local stream exceptions
13  kLocalUnknown = 1100,
14  kLocalDeviceNotFound = 1102,
15  kLocalInvalidOption = 1104,
16  kLocalNotSupported = 1105,
17  // kP2P* for p2p exceptions
18  kP2PUnknown = 2001,
19  kP2PConnectionAuthFailed = 2121,
20  kP2PMessageTargetUnreachable = 2201,
21  kP2PClientUnsupportedMethod = 2401,
22  kP2PClientInvalidArgument = 2402,
23  kP2PClientInvalidState = 2403,
24  kP2PClientRemoteNotAllowed = 2404,
25  kP2PClientRemoteNotExisted = 2405,
26  // kConference* for conference exceptions
27  kConferenceUnknown = 3001,
28  kConferenceInvalidUser,
29  kConferenceInvalidParam,
30  kConferenceNotSupported,
31  kConferenceInvalidToken,
32  kConferenceInvalidSession
33 };
35 class Exception {
36  public:
38  Exception();
44  Exception(const ExceptionType& type, const std::string& message);
45  virtual ~Exception() {}
50  ExceptionType Type() const;
55  std::string Message() const;
56  private:
57  const ExceptionType type_;
58  const std::string message_;
59 };
60 }
61 }
62 #endif // OWT_BASE_EXCEPTION_H_
Definition: audioplayerinterface.h:8
std::string Message() const
Get exception message.
Class for exceptions.
Definition: exception.h:35
Exception()
Default constructor for exceptions.
ExceptionType Type() const
Get exception type.