blob: ec4662976d4e5061bd9ec196c43341f9eb602e4d [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>
Aditya Agarwalfdef47e2007-02-07 03:54:18 +000024#include <Thrift.h>
Marc Slemko525c2022006-07-20 00:29:35 +000025
T Jake Lucianib5e62212009-01-31 22:36:20 +000026namespace apache { namespace thrift { namespace concurrency {
Marc Slemko525c2022006-07-20 00:29:35 +000027
T Jake Lucianib5e62212009-01-31 22:36:20 +000028class NoSuchTaskException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000029
T Jake Lucianib5e62212009-01-31 22:36:20 +000030class UncancellableTaskException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000031
T Jake Lucianib5e62212009-01-31 22:36:20 +000032class InvalidArgumentException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000033
T Jake Lucianib5e62212009-01-31 22:36:20 +000034class IllegalStateException : public apache::thrift::TException {};
Marc Slemko525c2022006-07-20 00:29:35 +000035
T Jake Lucianib5e62212009-01-31 22:36:20 +000036class TimedOutException : public apache::thrift::TException {
David Reiss0c90f6f2008-02-06 22:18:40 +000037public:
Aditya Agarwale04475b2007-05-23 02:14:58 +000038 TimedOutException():TException("TimedOutException"){};
David Reiss0c90f6f2008-02-06 22:18:40 +000039 TimedOutException(const std::string& message ) :
Aditya Agarwale04475b2007-05-23 02:14:58 +000040 TException(message) {}
41};
Marc Slemko525c2022006-07-20 00:29:35 +000042
T Jake Lucianib5e62212009-01-31 22:36:20 +000043class TooManyPendingTasksException : public apache::thrift::TException {
David Reiss0c90f6f2008-02-06 22:18:40 +000044public:
Aditya Agarwale04475b2007-05-23 02:14:58 +000045 TooManyPendingTasksException():TException("TooManyPendingTasksException"){};
David Reiss0c90f6f2008-02-06 22:18:40 +000046 TooManyPendingTasksException(const std::string& message ) :
Aditya Agarwale04475b2007-05-23 02:14:58 +000047 TException(message) {}
48};
Marc Slemko3a3b53b2007-05-22 23:59:54 +000049
T Jake Lucianib5e62212009-01-31 22:36:20 +000050class SystemResourceException : public apache::thrift::TException {
Marc Slemko3a3b53b2007-05-22 23:59:54 +000051public:
52 SystemResourceException() {}
53
54 SystemResourceException(const std::string& message) :
55 TException(message) {}
56};
57
T Jake Lucianib5e62212009-01-31 22:36:20 +000058}}} // apache::thrift::concurrency
Marc Slemko525c2022006-07-20 00:29:35 +000059
Mark Sleef5f2be42006-09-05 21:05:31 +000060#endif // #ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_