2 * Copyright (c) 2014 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 * @file InvalidProtocolException.h
18 * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
20 * @brief Implementation of InvalidProtocolException
23 #ifndef SRC_COMMON_EXCEPTIONS_INVALIDPROTOCOLEXCEPTION_H_
24 #define SRC_COMMON_EXCEPTIONS_INVALIDPROTOCOLEXCEPTION_H_
29 #include "Exception.h"
33 class InvalidProtocolException : public Exception {
42 std::string m_whatMessage;
43 ExceptionType m_exceptionType;
46 InvalidProtocolException(ExceptionType exceptionType) :
47 m_exceptionType(exceptionType) {
48 switch(m_exceptionType) {
49 case InvalidSignature:
50 m_whatMessage = "No valid signature found";
53 m_whatMessage = "Wrong request code";
56 m_whatMessage = "Unknown problem";
62 virtual ~InvalidProtocolException() = default;
64 virtual const std::string message(void) const {
68 ExceptionType exceptionTyp(void) const {
69 return m_exceptionType;
75 #endif /* SRC_COMMON_EXCEPTIONS_INVALIDPROTOCOLEXCEPTION_H_ */