51Degrees Common C/C++  4.1

A shared functionality library that is used by 51Degrees products

Exceptions.hpp

1 /* *********************************************************************
2  * This Source Code Form 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 Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0.
8  *
9  * If a copy of the MPL was not distributed with this file, You can obtain
10  * one at http://mozilla.org/MPL/2.0/.
11  *
12  * This Source Code Form is "Incompatible With Secondary Licenses", as
13  * defined by the Mozilla Public License, v. 2.0.
14  * ********************************************************************* */
15 
16 #ifndef FIFTYONE_DEGREES_EXCEPTIONS_HPP
17 #define FIFTYONE_DEGREES_EXCEPTIONS_HPP
18 
19 #include <string>
20 #include <exception>
21 #include <stdexcept>
22 #include "exceptions.h"
23 #include "status.h"
24 #include "memory.h"
25 
26 using namespace std;
27 
28 namespace FiftyoneDegrees {
29  namespace Common {
33  class StatusCodeException : public exception {
34  public:
40 
49  const char *fileName);
50 
55 
60  const char* what() const noexcept;
61  protected:
62 
67 
69  string message;
70  };
71 
76  public:
82  };
83 
89  class NotImplementedException : public runtime_error {
90  public:
95  };
96 
102  class InvalidPropertyException : public runtime_error {
103  public:
108 
113  InvalidPropertyException(const char *message);
114  };
115 
119  class EvidenceException : public runtime_error {
120  public:
125  };
126 
133  class TooManyValuesException : public runtime_error {
134  public:
139  };
140 
145  class NoValuesAvailableException : public runtime_error {
146  public:
151 
156  NoValuesAvailableException(const char *message);
157  };
158  }
159 }
160 
161 #endif
fiftyoneDegreesStatusCode
Status returned from the initialisation of a resource.
Definition: status.h:75
Exception thrown when a property does not exist in the data set.
Definition: Exceptions.hpp:102
Fatal exception meaning the process should be halted.
Definition: Exceptions.hpp:75
51Degrees base namespace.
Definition: Collection.hpp:24
Exception indicating that there were no values in the results for the requested property.
Definition: Exceptions.hpp:145
Exception indicating that an attempt was made to return a single value type (e.g.
Definition: Exceptions.hpp:133
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition: exceptions.h:109
Exception thrown when there is a problem with the evidence provided.
Definition: Exceptions.hpp:119
Exception indicating that the method has not been implemented by the class.
Definition: Exceptions.hpp:89
Exception containing the status code which caused the exception.
Definition: Exceptions.hpp:33
string message
Error message from the status code.
Definition: Exceptions.hpp:69