AddressExceptions.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Socket_Protocols_AddressExceptions_
18 #define HH_SENF_Socket_Protocols_AddressExceptions_ 1
19 
20 // Custom includes
21 #include <senf/Utils/Exception.hh>
22 
23 //#include "AddressExceptions.mpp"
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 
26 namespace senf {
27 
30  {
31  protected:
32  AddressException(std::string const & msg)
33  : senf::Exception(msg) {}
34  };
35 
38  {
39  AddressSyntaxException() : AddressException("invalid address syntax") {}
40  AddressSyntaxException(std::string const & addr)
41  : AddressException("Invalid address syntax (\"" + addr + "\")") {}
42  };
43 
46  {
47  UnknownHostnameException() : AddressException("failed to resolve hostname") {}
48  UnknownHostnameException(std::string const & hostname)
49  : AddressException("Failed to resolve hostname (\"" + hostname + "\")") {}
50  };
51 
54  {
55  UnknownInterfaceException() : AddressException("Unknown interface") {}
56  UnknownInterfaceException(std::string const & interface)
57  : AddressException("Unknown interface (\"" + interface + "\")") {}
58  };
59 
60 }
61 
62 //-/////////////////////////////////////////////////////////////////////////////////////////////////
63 //#include "AddressExceptions.cci"
64 //#include "AddressExceptions.ct"
65 //#include "AddressExceptions.cti"
66 #endif
67 
68 
69 // Local Variables:
70 // mode: c++
71 // fill-column: 100
72 // comment-column: 40
73 // c-file-style: "senf"
74 // indent-tabs-mode: nil
75 // ispell-local-dictionary: "american"
76 // compile-command: "scons -u test"
77 // End:
AddressException(std::string const &msg)
UnknownHostnameException(std::string const &hostname)
UnknownInterfaceException(std::string const &interface)
AddressSyntaxException(std::string const &addr)
Base-class for Address exceptions.
Invalid address syntax.