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 enum class EError : unsigned int {
36 ERROR_INVALID_ARGUMENT,
38 ERROR_INVALID_POINTER,
39 ERROR_INVALID_OPERATION,
42 ERROR_NOT_INITIALIZED,
44 ERROR_NOT_SUPPORTED_TYPE,
46 ERROR_PERMISSION_DENIED,
48 ERROR_DEVICE_POLICY_RESTRICTION,
49 ERROR_DEVICE_NOT_OPENED,
50 ERROR_DEVICE_NOT_CLOSED,
53 ERROR_INTERNAL_OPERATION,
54 ERROR_FAILED_OPERATION,
57 ERROR_POLICY_INTERRUPTED,
58 ERROR_POLICY_DUPLICATED,
63 static constexpr auto MSG_LENGTH = 512;
64 CAudioError(EError err, const char* msg, const char* file, const char* func, int line);
66 const char *what() const noexcept override;
67 const char* getErrorMsg() const noexcept;
68 EError getError() const noexcept;
71 static const char* __convertErrorToString(EError err) noexcept;
74 std::runtime_error __mFullMsg;
78 } /* namespace tizen_media_audio */
81 #endif /* __TIZEN_MEDIA_AUDIO_IO_CAUDIOERROR_H__ */