Commit eab6da6a authored by Eric Niebler's avatar Eric Niebler Committed by Facebook Github Bot

give folly future's exceptions default visibility

Summary: Exception types should have default visibility, otherwise RTTI doesn't work right.

Reviewed By: elsteveogrande

Differential Revision: D5976415

fbshipit-source-id: 45dcfe3476b513aa49a6f78352318f31d381ada7
parent b6861c02
...@@ -19,14 +19,16 @@ ...@@ -19,14 +19,16 @@
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <folly/CPortability.h>
namespace folly { namespace folly {
class FutureException : public std::logic_error { class FOLLY_EXPORT FutureException : public std::logic_error {
public: public:
using std::logic_error::logic_error; using std::logic_error::logic_error;
}; };
class BrokenPromise : public FutureException { class FOLLY_EXPORT BrokenPromise : public FutureException {
public: public:
explicit BrokenPromise(const std::string& type) explicit BrokenPromise(const std::string& type)
: FutureException("Broken promise for type name `" + type + '`') {} : FutureException("Broken promise for type name `" + type + '`') {}
...@@ -34,54 +36,54 @@ class BrokenPromise : public FutureException { ...@@ -34,54 +36,54 @@ class BrokenPromise : public FutureException {
explicit BrokenPromise(const char* type) : BrokenPromise(std::string(type)) {} explicit BrokenPromise(const char* type) : BrokenPromise(std::string(type)) {}
}; };
class NoState : public FutureException { class FOLLY_EXPORT NoState : public FutureException {
public: public:
NoState() : FutureException("No state") {} NoState() : FutureException("No state") {}
}; };
[[noreturn]] void throwNoState(); [[noreturn]] void throwNoState();
class PromiseAlreadySatisfied : public FutureException { class FOLLY_EXPORT PromiseAlreadySatisfied : public FutureException {
public: public:
PromiseAlreadySatisfied() : FutureException("Promise already satisfied") {} PromiseAlreadySatisfied() : FutureException("Promise already satisfied") {}
}; };
[[noreturn]] void throwPromiseAlreadySatisfied(); [[noreturn]] void throwPromiseAlreadySatisfied();
class FutureNotReady : public FutureException { class FOLLY_EXPORT FutureNotReady : public FutureException {
public: public:
FutureNotReady() : FutureException("Future not ready") {} FutureNotReady() : FutureException("Future not ready") {}
}; };
[[noreturn]] void throwFutureNotReady(); [[noreturn]] void throwFutureNotReady();
class FutureAlreadyRetrieved : public FutureException { class FOLLY_EXPORT FutureAlreadyRetrieved : public FutureException {
public: public:
FutureAlreadyRetrieved() : FutureException("Future already retrieved") {} FutureAlreadyRetrieved() : FutureException("Future already retrieved") {}
}; };
[[noreturn]] void throwFutureAlreadyRetrieved(); [[noreturn]] void throwFutureAlreadyRetrieved();
class FutureCancellation : public FutureException { class FOLLY_EXPORT FutureCancellation : public FutureException {
public: public:
FutureCancellation() : FutureException("Future was cancelled") {} FutureCancellation() : FutureException("Future was cancelled") {}
}; };
class TimedOut : public FutureException { class FOLLY_EXPORT TimedOut : public FutureException {
public: public:
TimedOut() : FutureException("Timed out") {} TimedOut() : FutureException("Timed out") {}
}; };
[[noreturn]] void throwTimedOut(); [[noreturn]] void throwTimedOut();
class PredicateDoesNotObtain : public FutureException { class FOLLY_EXPORT PredicateDoesNotObtain : public FutureException {
public: public:
PredicateDoesNotObtain() : FutureException("Predicate does not obtain") {} PredicateDoesNotObtain() : FutureException("Predicate does not obtain") {}
}; };
[[noreturn]] void throwPredicateDoesNotObtain(); [[noreturn]] void throwPredicateDoesNotObtain();
struct NoFutureInSplitter : FutureException { struct FOLLY_EXPORT NoFutureInSplitter : FutureException {
NoFutureInSplitter() : FutureException("No Future in this FutureSplitter") {} NoFutureInSplitter() : FutureException("No Future in this FutureSplitter") {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment