Easemob Windows SDK
emerror.h
1 /************************************************************
2  * * EaseMob CONFIDENTIAL
3  * __________________
4  * Copyright (C) 2015 EaseMob Technologies. All rights reserved.
5  *
6  * NOTICE: All information contained herein is, and remains
7  * the property of EaseMob Technologies.
8  * Dissemination of this information or reproduction of this material
9  * is strictly forbidden unless prior written permission is obtained
10  * from EaseMob Technologies.
11  */
12 //
13 // EMError.h
14 //
15 // Copyright (c) 2015 EaseMob Inc. All rights reserved.
16 //
17 
18 #ifndef __easemob__EMError__
19 #define __easemob__EMError__
20 
21 #include "embaseobject.h"
22 
23 #include <string>
24 
25 namespace easemob {
26 
27 class EASEMOB_API EMError : EMBaseObject
28 {
29 public:
30 
31  typedef enum
32  {
33  EM_NO_ERROR = 0, //No error
34 
35  GENERAL_ERROR, //General error
36  NETWORK_ERROR, //Network isn't avaliable
37  DATABASE_ERROR, //Database operation failed
38 
39  INVALID_APP_KEY = 100, //App key is invalid
40  INVALID_USER_NAME, //User name is illegal
41  INVALID_PASSWORD, //Password is illegal
42  INVALID_URL, //URL is invalid
43 
44  USER_ALREADY_LOGIN = 200, //User has already login
45  USER_NOT_LOGIN, //User has not login
46  USER_AUTHENTICATION_FAILED, //User name or password is wrong
47  USER_ALREADY_EXIST, //User has already exist
48  USER_NOT_FOUND, //User dosn't exist
49  USER_ILLEGAL_ARGUMENT, //Illegal argument
50  USER_LOGIN_ANOTHER_DEVICE, //User login on another device
51  USER_REMOVED, //User was removed from server
52  USER_REG_FAILED, //User register failed
53  PUSH_UPDATECONFIGS_FAILED, //Update push configs failed
54  USER_PERMISSION_DENIED, //User has no right for this operation
55  USER_BINDDEVICETOKEN_FAILED, //Bind device token failed
56  USER_UNBIND_DEVICETOKEN_FAILED, //Unbind device token failed
57 
58  SERVER_NOT_REACHABLE = 300, //Server is not reachable
59  SERVER_TIMEOUT, //Wait server response timeout
60  SERVER_BUSY, //Server is busy
61  SERVER_UNKNOWN_ERROR, //Unknown server error
62  SERVER_GET_DNSLIST_FAILED, //Can't get dns list
63  SERVER_SERVING_DISABLED, //Serving is disabled
64 
65  FILE_NOT_FOUND = 400, //File isn't exist
66  FILE_INVALID, //File is invalid
67  FILE_UPLOAD_FAILED, //Failed uploading file to server
68  FILE_DOWNLOAD_FAILED, //Failed donwloading file from server
69 
70  MESSAGE_INVALID = 500, //Message is invalid
71  MESSAGE_INCLUDE_ILLEGAL_CONTENT, //Message include illegal content
72  MESSAGE_SEND_TRAFFIC_LIMIT,
73  MESSAGE_ENCRYPTION_ERROR,
74 
75  GROUP_INVALID_ID = 600, //Group id is invalid
76  GROUP_ALREADY_JOINED, //User has already joined the group
77  GROUP_NOT_JOINED, //User has not joined the group
78  GROUP_PERMISSION_DENIED, //User has no right for this operation
79  GROUP_MEMBERS_FULL, //Group members is full
80  GROUP_NOT_EXIST, //Group is not exist
81 
82  CHATROOM_INVALID_ID = 700, //Chatroom id is invalid
83  CHATROOM_ALREADY_JOINED, //User has already joined the chatroom
84  CHATROOM_NOT_JOINED, //User has not joined the chatroom
85  CHATROOM_PERMISSION_DENIED, //User has no right for this operation
86  CHATROOM_MEMBERS_FULL, //Chatroom members is full
87  CHATROOM_NOT_EXIST, //Chatroom is not exist
88 
89  CALL_INVALID_ID = 800, //Call id is invalid
90  CALL_BUSY, //Call in progress
91  CALL_REMOTE_OFFLINE, //remote offline
92  CALL_CONNECTION_FAILED, //Establish connection failed
93  CALL_INVALID_CAMERA_INDEX, //Invalid camera index
94  CALL_OPTION_CANCEL,
95  CALL_PERMISSION_DENIED,
96  CALL_NOT_JOINED,
97  CALL_JOIN_FAILED,
98  CALL_CREATE_FAILED,
99  CALL_UNSUB_FAILED,
100  }EMErrorCode;
101 
110  EMError(const EMError &e) {
111  mErrorCode = e.mErrorCode;
112  mDescription = e.mDescription;
113  }
114  EMError(int errorCode = EM_NO_ERROR, const std::string &description = "");
115  void setErrorCode(int errorCode, const std::string &description = "");
116  virtual ~EMError() {}
117  EMError & operator=(const EMError& e) {
118  mErrorCode = e.mErrorCode;
119  mDescription = e.mDescription;
120  return *this;
121  }
122 
123  int mErrorCode;
124  std::string mDescription;
125 };
126 
127 typedef std::shared_ptr<EMError> EMErrorPtr;
128 
129 }
130 
131 #endif /* defined(__easemob__EMError__) */
Definition: emerror.h:27
Definition: emattributevalue.h:28
Definition: embaseobject.h:28
EMError(const EMError &e)
EMCallback&#39;s constructor.
Definition: emerror.h:110