blob: cdc85387f70f2cc00aff455752e1e62f4809c086 [file] [log] [blame]
Mark Slee9f0c6512007-02-28 23:58:26 +00001// Copyright (c) 2006- Facebook
2// Distributed under the Thrift Software License
3//
4// See accompanying file LICENSE or visit the Thrift site at:
5// http://developers.facebook.com/thrift/
6
Mark Sleef5f2be42006-09-05 21:05:31 +00007#ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_
8#define _THRIFT_CONCURRENCY_EXCEPTION_H_ 1
Marc Slemko525c2022006-07-20 00:29:35 +00009
10#include <exception>
Aditya Agarwalfdef47e2007-02-07 03:54:18 +000011#include <Thrift.h>
Marc Slemko525c2022006-07-20 00:29:35 +000012
T Jake Lucianib5e62212009-01-31 22:36:20 +000013namespace apache { namespace thrift { namespace concurrency {
Marc Slemko525c2022006-07-20 00:29:35 +000014
T Jake Lucianib5e62212009-01-31 22:36:20 +000015class NoSuchTaskException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000016
T Jake Lucianib5e62212009-01-31 22:36:20 +000017class UncancellableTaskException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000018
T Jake Lucianib5e62212009-01-31 22:36:20 +000019class InvalidArgumentException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000020
T Jake Lucianib5e62212009-01-31 22:36:20 +000021class IllegalStateException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000022
T Jake Lucianib5e62212009-01-31 22:36:20 +000023class TimedOutException : public apache::thrift::TException {
David Reiss0c90f6f2008-02-06 22:18:40 +000024public:
Aditya Agarwale04475b2007-05-23 02:14:58 +000025 TimedOutException():TException("TimedOutException"){};
David Reiss0c90f6f2008-02-06 22:18:40 +000026 TimedOutException(const std::string& message ) :
Aditya Agarwale04475b2007-05-23 02:14:58 +000027 TException(message) {}
28};
Marc Slemko525c2022006-07-20 00:29:35 +000029
T Jake Lucianib5e62212009-01-31 22:36:20 +000030class TooManyPendingTasksException : public apache::thrift::TException {
David Reiss0c90f6f2008-02-06 22:18:40 +000031public:
Aditya Agarwale04475b2007-05-23 02:14:58 +000032 TooManyPendingTasksException():TException("TooManyPendingTasksException"){};
David Reiss0c90f6f2008-02-06 22:18:40 +000033 TooManyPendingTasksException(const std::string& message ) :
Aditya Agarwale04475b2007-05-23 02:14:58 +000034 TException(message) {}
35};
Marc Slemko3a3b53b2007-05-22 23:59:54 +000036
T Jake Lucianib5e62212009-01-31 22:36:20 +000037class SystemResourceException : public apache::thrift::TException {
Marc Slemko3a3b53b2007-05-22 23:59:54 +000038public:
39 SystemResourceException() {}
40
41 SystemResourceException(const std::string& message) :
42 TException(message) {}
43};
44
T Jake Lucianib5e62212009-01-31 22:36:20 +000045}}} // apache::thrift::concurrency
Marc Slemko525c2022006-07-20 00:29:35 +000046
Mark Sleef5f2be42006-09-05 21:05:31 +000047#endif // #ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_