2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_MEDIA_AUDIO_IO_CAUDIOERROR_H__
18 #define __TIZEN_MEDIA_AUDIO_IO_CAUDIOERROR_H__
27 namespace tizen_media_audio {
31 class CAudioError : public std::exception {
33 /* Enums Definition */
34 enum class EError : unsigned int {
37 ERROR_INVALID_ARGUMENT,
39 ERROR_INVALID_POINTER,
40 ERROR_INVALID_OPERATION,
43 ERROR_NOT_INITIALIZED,
45 ERROR_NOT_SUPPORTED_TYPE,
47 ERROR_PERMISSION_DENIED,
49 ERROR_DEVICE_POLICY_RESTRICTION,
50 ERROR_DEVICE_NOT_OPENED,
51 ERROR_DEVICE_NOT_CLOSED,
54 ERROR_INTERNAL_OPERATION,
55 ERROR_FAILED_OPERATION,
58 ERROR_POLICY_INTERRUPTED,
59 ERROR_POLICY_DUPLICATED,
64 /* Constants Definition */
65 static constexpr unsigned int MSG_LENGTH = 512;
67 /* Constructor & Destructor */
68 explicit CAudioError(EError err);
69 CAudioError(EError err, const char* msg, const char* file, const char* func, int line);
70 ~CAudioError() = default;
72 const char *what() const noexcept override {
73 return __mFullMsg.c_str();
76 const char* getErrorMsg() const noexcept;
77 const EError getError() const noexcept;
80 static const char* __convertErrorToString(EError err) noexcept;
84 std::string __mFullMsg;
89 } /* namespace tizen_media_audio */
92 #endif /* __TIZEN_MEDIA_AUDIO_IO_CAUDIOERROR_H__ */