1 // Tizen Web Device API
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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_DOWNLOAD_UTIL_H__
18 #define __TIZEN_DOWNLOAD_UTIL_H__
22 #include <PlatformException.h>
25 #include <net_connection.h>
32 template <class T = DeviceAPI::Common::UnknownException>
33 static void throwDownloadException(const int errorCode, const std::string &hint) {
34 std::string log = DownloadUtil::getDownloadLogMessage(errorCode, hint);
35 LOGE("%s", log.c_str());
38 static std::string getDownloadErrorMessage(const int errorCode);
39 static std::string getDownloadLogMessage(const int errorCode, const std::string &hint);
41 template <class T = DeviceAPI::Common::UnknownException>
42 static void throwConnectionException(const int errorCode, const std::string &hint) {
43 std::string log = DownloadUtil::getConnectionLogMessage(errorCode, hint);
44 LOGE("%s", log.c_str());
47 static std::string getConnectionErrorMessage(const int errorCode);
48 static std::string getConnectionLogMessage(const int errorCode, const std::string &hint);
54 #endif // __TIZEN_DOWNLOAD_UTIL_H__