2 // Tizen Web Device API
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 #ifndef _PLATFORM_EXCEPTION_H_
20 #define _PLATFORM_EXCEPTION_H_
23 #include <JavaScriptCore/JavaScript.h>
29 class BasePlatformException{
31 BasePlatformException(int code, const char* name, const char* message);
32 BasePlatformException(JSContextRef ctx, JSValueRef exception);
34 virtual int getCode() const;
35 virtual std::string getName() const;
36 virtual std::string getMessage() const;
44 class TypeMismatchException : public BasePlatformException{
46 TypeMismatchException(const char* message);
47 TypeMismatchException(JSContextRef ctx, JSValueRef exception);
51 class InvalidValuesException : public BasePlatformException{
53 InvalidValuesException(const char* message);
54 InvalidValuesException(JSContextRef ctx, JSValueRef exception);
58 class IOException : public BasePlatformException{
60 IOException(const char* message);
61 IOException(JSContextRef ctx, JSValueRef exception);
65 class UnknownException : public BasePlatformException{
67 UnknownException(const char* message);
68 UnknownException(JSContextRef ctx, JSValueRef exception);
71 class ServiceNotAvailableException : public BasePlatformException{
73 ServiceNotAvailableException(const char* message);
74 ServiceNotAvailableException(JSContextRef ctx, JSValueRef exception);
77 class SecurityException : public BasePlatformException{
79 SecurityException(const char* message);
80 SecurityException(JSContextRef ctx, JSValueRef exception);
83 class NotSupportedException : public BasePlatformException{
85 NotSupportedException(const char* message);
86 NotSupportedException(JSContextRef ctx, JSValueRef exception);
89 class NotFoundException : public BasePlatformException{
91 NotFoundException(const char* message);
92 NotFoundException(JSContextRef ctx, JSValueRef exception);
102 #endif //_PLATFORM_EXCEPTION_H_