blob: 6438fda101e290ff44570db6d0a12a253aefcc5a [file] [log] [blame]
David Reissea2cba82009-03-30 21:35:00 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Mark Slee9f0c6512007-02-28 23:58:26 +000019
Mark Sleef5f2be42006-09-05 21:05:31 +000020#ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_
21#define _THRIFT_CONCURRENCY_EXCEPTION_H_ 1
Marc Slemko525c2022006-07-20 00:29:35 +000022
23#include <exception>
Roger Meier49ff8b12012-04-13 09:12:31 +000024#include <thrift/Thrift.h>
Marc Slemko525c2022006-07-20 00:29:35 +000025
Konrad Grochowski16a23a62014-11-13 15:33:38 +010026namespace apache {
27namespace thrift {
28namespace concurrency {
Marc Slemko525c2022006-07-20 00:29:35 +000029
T Jake Lucianib5e62212009-01-31 22:36:20 +000030class NoSuchTaskException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000031
T Jake Lucianib5e62212009-01-31 22:36:20 +000032class UncancellableTaskException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000033
T Jake Lucianib5e62212009-01-31 22:36:20 +000034class InvalidArgumentException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000035
Jake Farrell4013fa32011-09-09 04:10:32 +000036class IllegalStateException : public apache::thrift::TException {
37public:
38 IllegalStateException() {}
39 IllegalStateException(const std::string& message) : TException(message) {}
40};
Marc Slemko525c2022006-07-20 00:29:35 +000041
T Jake Lucianib5e62212009-01-31 22:36:20 +000042class TimedOutException : public apache::thrift::TException {
David Reiss0c90f6f2008-02-06 22:18:40 +000043public:
Konrad Grochowski16a23a62014-11-13 15:33:38 +010044 TimedOutException() : TException("TimedOutException"){};
45 TimedOutException(const std::string& message) : TException(message) {}
Aditya Agarwale04475b2007-05-23 02:14:58 +000046};
Marc Slemko525c2022006-07-20 00:29:35 +000047
T Jake Lucianib5e62212009-01-31 22:36:20 +000048class TooManyPendingTasksException : public apache::thrift::TException {
David Reiss0c90f6f2008-02-06 22:18:40 +000049public:
Konrad Grochowski16a23a62014-11-13 15:33:38 +010050 TooManyPendingTasksException() : TException("TooManyPendingTasksException"){};
51 TooManyPendingTasksException(const std::string& message) : TException(message) {}
Aditya Agarwale04475b2007-05-23 02:14:58 +000052};
Marc Slemko3a3b53b2007-05-22 23:59:54 +000053
T Jake Lucianib5e62212009-01-31 22:36:20 +000054class SystemResourceException : public apache::thrift::TException {
Marc Slemko3a3b53b2007-05-22 23:59:54 +000055public:
Konrad Grochowski16a23a62014-11-13 15:33:38 +010056 SystemResourceException() {}
Marc Slemko3a3b53b2007-05-22 23:59:54 +000057
Konrad Grochowski16a23a62014-11-13 15:33:38 +010058 SystemResourceException(const std::string& message) : TException(message) {}
Marc Slemko3a3b53b2007-05-22 23:59:54 +000059};
Konrad Grochowski16a23a62014-11-13 15:33:38 +010060}
61}
62} // apache::thrift::concurrency
Marc Slemko525c2022006-07-20 00:29:35 +000063
Mark Sleef5f2be42006-09-05 21:05:31 +000064#endif // #ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_