Sauce-0.10.1
A C++ Dependency Injection Framework
exceptions.h
1#ifndef SAUCE_EXCEPTIONS_H_
2#define SAUCE_EXCEPTIONS_H_
3
4#include <string>
5#include <stdexcept>
6
7namespace sauce {
8
12class Exception: public std::runtime_error {
13public:
14 Exception(std::string message):
15 std::runtime_error(message) {}
16};
17
22public:
23 UnboundException(std::string const name):
24 Exception("Request for unbound interface " + name + ".") {}
25};
26
30template<typename Dependency>
32public:
33 UnboundExceptionFor(std::string const name): UnboundException(name) {}
34};
35
40public:
42 Exception("Binding is incomplete.") {}
43};
44
48template<typename Dependency>
50public:
52};
53
58public:
60 Exception("Request for unbound interface.") {}
61};
62
66template<typename Dependency>
68public:
70};
71
76public:
78 Exception("Out of dependency scope.") {}
79};
80
84template<typename Scope>
86public:
88};
89
94public:
96 Exception("Already in scope.") {}
97};
98
102template<typename Scope>
104public:
106};
107
112public:
114 Exception("Can't exit SingletonScope") {}
115};
116
117}
118
119#endif // SAUCE_EXCEPTIONS_H_
Thrown when re-entering the given scope, which is already open.
Definition: exceptions.h:103
Thrown when re-entering a scope that is already open.
Definition: exceptions.h:93
Thrown when a dependency cycle is found for the given interface.
Definition: exceptions.h:67
Thrown when a dependency cycle is found.
Definition: exceptions.h:57
Base class for all sauce exceptions.
Definition: exceptions.h:12
Thrown when exiting the singleton scope.
Definition: exceptions.h:111
Thrown when a provision is requested outside of its given, bound scope.
Definition: exceptions.h:85
Thrown when a provision is requested outside of its bound scope.
Definition: exceptions.h:75
Thrown when a binding hasn't been completely specified for the given interface.
Definition: exceptions.h:49
Thrown when a binding hasn't been completely specified.
Definition: exceptions.h:39
Thrown when a binding cannot be found for the given interface.
Definition: exceptions.h:31
Thrown when a binding cannot be found.
Definition: exceptions.h:21