1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #include "ESException.h"
23 #include "OCException.h"
30 ESException::ESException()
34 ESException::ESException(const std::string& what) :
39 ESException::ESException(std::string&& what) :
40 m_what{ std::move(what) }
44 ESException::~ESException() noexcept
48 const char* ESException::what() const noexcept
50 return m_what.c_str();
54 ESPlatformException::ESPlatformException(OCStackResult reason) :
55 ESException{ "Failed : " + OC::OCException::reason(reason) },
60 OCStackResult ESPlatformException::getReasonCode() const
65 std::string ESPlatformException::getReason() const
67 return OC::OCException::reason(m_reason);
71 ESBadRequestException::ESBadRequestException(const std::string& what) :
76 ESBadRequestException::ESBadRequestException(std::string&& what) :
77 ESException{ std::move(what) }
82 ESInvalidParameterException::ESInvalidParameterException(const std::string& what) :
87 ESInvalidParameterException::ESInvalidParameterException(std::string&& what) :
88 ESException{ std::move(what) }
93 ESBadGetException::ESBadGetException(const std::string& what) :
98 ESBadGetException::ESBadGetException(std::string&& what) :
99 ESException{ std::move(what) }
104 ESInvalidKeyException::ESInvalidKeyException(const std::string& what) :
109 ESInvalidKeyException::ESInvalidKeyException(std::string&& what) :
110 ESException{ std::move(what) }