Fast DDS  Version 3.1.0
Fast DDS
Loading...
Searching...
No Matches
Exception.hpp
1// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
20#ifndef FASTDDS_DDS_XTYPES_EXCEPTION__EXCEPTION_HPP
21#define FASTDDS_DDS_XTYPES_EXCEPTION__EXCEPTION_HPP
22
23#include <stdexcept>
24#include <string>
25
26#include <fastdds/fastdds_dll.hpp>
27
28namespace eprosima {
29namespace fastdds {
30namespace dds {
31namespace xtypes {
32
37{
38protected:
39
40 Exception() = default;
41
42public:
43
44 FASTDDS_EXPORTED_API virtual ~Exception() throw() = default;
45
51 FASTDDS_EXPORTED_API virtual const char* what() const throw() = 0;
52
53};
54
58class InvalidArgumentError : public Exception, public std::invalid_argument
59{
60public:
61
62 FASTDDS_EXPORTED_API explicit InvalidArgumentError(
63 const std::string& msg);
64
65 FASTDDS_EXPORTED_API InvalidArgumentError(
66 const InvalidArgumentError& src);
67
68 FASTDDS_EXPORTED_API virtual ~InvalidArgumentError() throw();
69
70 FASTDDS_EXPORTED_API virtual const char* what() const throw();
71
72};
73
74} // xtypes
75} // dds
76} // fastdds
77} // eprosima
78
79#endif // FASTDDS_DDS_XTYPES_EXCEPTION__EXCEPTION_HPP
Exception: base class for specified DDS Exceptions.
Definition Exception.hpp:37
virtual FASTDDS_EXPORTED_API ~Exception()=default
virtual FASTDDS_EXPORTED_API const char * what() const =0
Retrieve information about the exception that was thrown.
Application is passing an invalid argument.
Definition Exception.hpp:59
FASTDDS_EXPORTED_API InvalidArgumentError(const InvalidArgumentError &src)
FASTDDS_EXPORTED_API InvalidArgumentError(const std::string &msg)
virtual FASTDDS_EXPORTED_API ~InvalidArgumentError()
Definition DomainParticipant.hpp:45
eProsima namespace.
Definition EntityId_t.hpp:388