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 <RCSException.h>
23 #include <OCException.h>
30 RCSException::RCSException()
34 RCSException::RCSException(const std::string& what) :
39 RCSException::RCSException(std::string&& what) :
40 m_what{ std::move(what) }
44 RCSException::~RCSException() noexcept
48 const char* RCSException::what() const noexcept
50 return m_what.c_str();
54 RCSPlatformException::RCSPlatformException(OCStackResult reason) :
55 RCSException{ "Failed : " + OC::OCException::reason(reason) },
60 OCStackResult RCSPlatformException::getReasonCode() const
65 std::string RCSPlatformException::getReason() const
67 return OC::OCException::reason(m_reason);
71 RCSBadRequestException::RCSBadRequestException(const std::string& what) :
76 RCSBadRequestException::RCSBadRequestException(std::string&& what) :
77 RCSException{ std::move(what) }
82 RCSInvalidParameterException::RCSInvalidParameterException(const std::string& what) :
87 RCSInvalidParameterException::RCSInvalidParameterException(std::string&& what) :
88 RCSException{ std::move(what) }
93 RCSBadGetException::RCSBadGetException(const std::string& what) :
98 RCSBadGetException::RCSBadGetException(std::string&& what) :
99 RCSException{ std::move(what) }
104 RCSInvalidKeyException::RCSInvalidKeyException(const std::string& what) :
109 RCSInvalidKeyException::RCSInvalidKeyException(std::string&& what) :
110 RCSException{ std::move(what) }