51Degrees Device Detection C/C++  4.1

A device detection library that is used natively or by 51Degrees products

Exceptions.hpp

1 /* *********************************************************************
2  * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3  * Copyright 2019 51 Degrees Mobile Experts Limited, 5 Charlotte Close,
4  * Caversham, Reading, Berkshire, United Kingdom RG4 7BY.
5  *
6  * This Original Work is licensed under the European Union Public Licence (EUPL)
7  * v.1.2 and is subject to its terms as set out below.
8  *
9  * If a copy of the EUPL was not distributed with this file, You can obtain
10  * one at https://opensource.org/licenses/EUPL-1.2.
11  *
12  * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13  * amended by the European Commission) shall be deemed incompatible for
14  * the purposes of the Work and the provisions of the compatibility
15  * clause in Article 5 of the EUPL shall not apply.
16  *
17  * If using the Work as, or as part of, a network application, by
18  * including the attribution notice(s) required under Article 5 of the EUPL
19  * in the end user terms of the application under an appropriate heading,
20  * such notice(s) shall fulfill the requirements of that article.
21  * ********************************************************************* */
22 
23 #ifndef FIFTYONE_DEGREES_EXCEPTIONS_HPP
24 #define FIFTYONE_DEGREES_EXCEPTIONS_HPP
25 
26 #include <string>
27 #include <exception>
28 #include <stdexcept>
29 #include "exceptions.h"
30 #include "status.h"
31 #include "memory.h"
32 
33 using namespace std;
34 
35 namespace FiftyoneDegrees {
36  namespace Common {
40  class StatusCodeException : public exception {
41  public:
47 
56  const char *fileName);
57 
62 
67  const char* what() const noexcept;
68  protected:
69 
74 
76  string message;
77  };
78 
83  public:
89  };
90 
96  class NotImplementedException : public runtime_error {
97  public:
102  };
103 
109  class InvalidPropertyException : public runtime_error {
110  public:
115 
120  InvalidPropertyException(const char *message);
121  };
122 
126  class EvidenceException : public runtime_error {
127  public:
132  };
133 
140  class TooManyValuesException : public runtime_error {
141  public:
146  };
147 
152  class NoValuesAvailableException : public runtime_error {
153  public:
158 
163  NoValuesAvailableException(const char *message);
164  };
165  }
166 }
167 
168 #endif
fiftyoneDegreesStatusCode
Status returned from the initialisation of a resource.
Definition: status.h:82
Exception thrown when a property does not exist in the data set.
Definition: Exceptions.hpp:109
Fatal exception meaning the process should be halted.
Definition: Exceptions.hpp:82
51Degrees base namespace.
Definition: ComponentMetaDataBuilderHash.hpp:34
Exception indicating that there were no values in the results for the requested property.
Definition: Exceptions.hpp:152
Exception indicating that an attempt was made to return a single value type (e.g.
Definition: Exceptions.hpp:140
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition: exceptions.h:116
Exception thrown when there is a problem with the evidence provided.
Definition: Exceptions.hpp:126
Exception indicating that the method has not been implemented by the class.
Definition: Exceptions.hpp:96
Exception containing the status code which caused the exception.
Definition: Exceptions.hpp:40
string message
Error message from the status code.
Definition: Exceptions.hpp:76