/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*
* AtomicHashMap --
*
#include <stdexcept>
#include <folly/AtomicHashArray.h>
+#include <folly/CPortability.h>
#include <folly/Likely.h>
#include <folly/ThreadCachedInt.h>
#include <folly/container/Foreach.h>
// Thrown when insertion fails due to running out of space for
// submaps.
-struct AtomicHashMapFullError : std::runtime_error {
+struct FOLLY_EXPORT AtomicHashMapFullError : std::runtime_error {
explicit AtomicHashMapFullError()
: std::runtime_error("AtomicHashMap is full")
{}
//! \endcode
class exception_wrapper final {
private:
- struct AnyException : std::exception {
+ struct FOLLY_EXPORT AnyException : std::exception {
std::type_info const* typeinfo_;
template <class T>
/* implicit */ AnyException(T&& t) noexcept : typeinfo_(&typeid(t)) {}
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Like folly::Optional, but can store a value *or* an error.
*
#include <glog/logging.h>
+#include <folly/CPortability.h>
#include <folly/CppAttributes.h>
#include <folly/Likely.h>
#include <folly/Optional.h>
/**
* An exception type thrown by Expected on catastrophic logic errors.
*/
-class BadExpectedAccess : public std::logic_error {
+class FOLLY_EXPORT BadExpectedAccess : public std::logic_error {
public:
BadExpectedAccess() : std::logic_error("bad Expected access") {}
};
* when the user tries to access the nested value but the Expected object is
* actually storing an error code.
*/
- class BadExpectedAccess : public folly::BadExpectedAccess {
+ class FOLLY_EXPORT BadExpectedAccess : public folly::BadExpectedAccess {
public:
explicit BadExpectedAccess(Error err)
: folly::BadExpectedAccess{}, error_(std::move(err)) {}
#include <tuple>
#include <type_traits>
+#include <folly/CPortability.h>
#include <folly/Conv.h>
#include <folly/FormatArg.h>
#include <folly/Range.h>
* makes the exception type small and noexcept-copyable like std::out_of_range,
* and therefore able to fit in-situ in exception_wrapper.
*/
-class FormatKeyNotFoundException : public std::out_of_range {
+class FOLLY_EXPORT FormatKeyNotFoundException : public std::out_of_range {
public:
explicit FormatKeyNotFoundException(StringPiece key);
#include <stdexcept>
+#include <folly/CPortability.h>
#include <folly/Conv.h>
#include <folly/Likely.h>
#include <folly/Portability.h>
namespace folly {
-class BadFormatArg : public std::invalid_argument {
+class FOLLY_EXPORT BadFormatArg : public std::invalid_argument {
using invalid_argument::invalid_argument;
};
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
#include <exception>
#include <string>
#include <utility>
+#include <folly/CPortability.h>
#include <folly/detail/IPAddress.h>
namespace folly {
/**
* Exception for invalid IP addresses.
*/
-class IPAddressFormatException : public std::exception {
+class FOLLY_EXPORT IPAddressFormatException : public std::exception {
public:
explicit IPAddressFormatException(std::string msg) noexcept
: msg_(std::move(msg)) {}
std::string msg_;
};
-class InvalidAddressFamilyException : public IPAddressFormatException {
+class FOLLY_EXPORT InvalidAddressFamilyException
+ : public IPAddressFormatException {
public:
explicit InvalidAddressFamilyException(std::string msg) noexcept
: IPAddressFormatException(std::move(msg)) {}
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
/*
const None none = nullptr;
-class OptionalEmptyException : public std::runtime_error {
+class FOLLY_EXPORT OptionalEmptyException : public std::runtime_error {
public:
OptionalEmptyException()
: std::runtime_error("Empty Optional cannot be unwrapped") {}
#include <typeinfo>
#include <utility>
+#include <folly/CPortability.h>
#include <folly/CppAttributes.h>
#include <folly/Traits.h>
#include <folly/detail/TypeList.h>
/**
* Exception type that is thrown on invalid access of an empty `Poly` object.
*/
-struct BadPolyAccess : std::exception {
+struct FOLLY_EXPORT BadPolyAccess : std::exception {
BadPolyAccess() = default;
char const* what() const noexcept override {
return "BadPolyAccess";
* Exception type that is thrown when attempting to extract from a `Poly` a
* value of the wrong type.
*/
-struct BadPolyCast : std::bad_cast {
+struct FOLLY_EXPORT BadPolyCast : std::bad_cast {
BadPolyCast() = default;
char const* what() const noexcept override {
return "BadPolyCast";
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Subprocess library, modeled after Python's subprocess module
* (http://docs.python.org/2/library/subprocess.html)
/**
* Base exception thrown by the Subprocess methods.
*/
-class SubprocessError : public std::runtime_error {
+class FOLLY_EXPORT SubprocessError : public std::runtime_error {
public:
using std::runtime_error::runtime_error;
};
/**
* Exception thrown by *Checked methods of Subprocess.
*/
-class CalledProcessError : public SubprocessError {
+class FOLLY_EXPORT CalledProcessError : public SubprocessError {
public:
explicit CalledProcessError(ProcessReturnCode rc);
~CalledProcessError() throw() override = default;
/**
* Exception thrown if the subprocess cannot be started.
*/
-class SubprocessSpawnError : public SubprocessError {
+class FOLLY_EXPORT SubprocessSpawnError : public SubprocessError {
public:
SubprocessSpawnError(const char* executable, int errCode, int errnoValue);
~SubprocessSpawnError() throw() override = default;
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
#include <folly/ExceptionWrapper.h>
namespace folly {
-class TryException : public std::logic_error {
+class FOLLY_EXPORT TryException : public std::logic_error {
public:
using std::logic_error::logic_error;
};
-class UsingUninitializedTry : public TryException {
+class FOLLY_EXPORT UsingUninitializedTry : public TryException {
public:
UsingUninitializedTry() : TryException("Using uninitialized try") {}
};
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
#include <functional>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_facade.hpp>
+#include <folly/CPortability.h>
#include <folly/Conv.h>
#include <folly/Format.h>
#include <folly/Likely.h>
namespace folly {
-struct TypeError : std::runtime_error {
+struct FOLLY_EXPORT TypeError : std::runtime_error {
explicit TypeError(const std::string& expected, dynamic::Type actual);
explicit TypeError(
const std::string& expected,
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
#include <exception>
#include <glog/logging.h>
+#include <folly/CPortability.h>
+
namespace folly {
// Some queue implementations (for example, LifoSemMPMCQueue or
// non-blocking (THROW) behaviors.
enum class QueueBehaviorIfFull { THROW, BLOCK };
-class QueueFullException : public std::runtime_error {
+class FOLLY_EXPORT QueueFullException : public std::runtime_error {
using std::runtime_error::runtime_error; // Inherit constructors.
};
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#pragma once
+#include <folly/CPortability.h>
#include <folly/ScopeGuard.h>
#include <folly/dynamic.h>
* With DynamicParser::OnError::THROW, reports the first error.
* It is forbidden to call releaseErrors() if you catch this.
*/
-struct DynamicParserParseError : public std::runtime_error {
+struct FOLLY_EXPORT DynamicParserParseError : public std::runtime_error {
explicit DynamicParserParseError(folly::dynamic error)
: std::runtime_error(folly::to<std::string>(
"DynamicParserParseError: ", detail::toPseudoJson(error)
* instead of reporting an error via releaseErrors(). It is unsafe to call
* any parser methods after catching a LogicError.
*/
-struct DynamicParserLogicError : public std::logic_error {
+struct FOLLY_EXPORT DynamicParserLogicError : public std::logic_error {
template <typename... Args>
explicit DynamicParserLogicError(Args&&... args)
: std::logic_error(folly::to<std::string>(std::forward<Args>(args)...)) {}
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
-#include <folly/Memory.h>
#include <map>
#include <string>
#include <unordered_map>
#include <vector>
+#include <folly/CPortability.h>
+#include <folly/Memory.h>
+
namespace folly {
namespace experimental {
EnvType env_;
};
-struct MalformedEnvironment : std::runtime_error {
+struct FOLLY_EXPORT MalformedEnvironment : std::runtime_error {
using std::runtime_error::runtime_error;
};
} // namespace experimental
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#include <folly/experimental/JSONSchema.h>
#include <boost/algorithm/string/replace.hpp>
#include <boost/regex.hpp>
+
+#include <folly/CPortability.h>
#include <folly/Conv.h>
#include <folly/Memory.h>
#include <folly/Optional.h>
/**
* We throw this exception when schema validation fails.
*/
-struct SchemaError : std::runtime_error {
-
+struct FOLLY_EXPORT SchemaError : std::runtime_error {
SchemaError(SchemaError&&) = default;
SchemaError(const SchemaError&) = default;
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
#include <functional>
#include <stdexcept>
+#include <folly/CPortability.h>
#include <folly/experimental/ProgramOptions.h>
namespace folly {
* empty; the message is only allowed when exiting with a non-zero status), and
* return the exit code. (Other exceptions will propagate out of run())
*/
-class ProgramExit : public std::runtime_error {
+class FOLLY_EXPORT ProgramExit : public std::runtime_error {
public:
explicit ProgramExit(int status, const std::string& msg = std::string());
int status() const { return status_; }
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
#pragma once
+#include <folly/CPortability.h>
#include <folly/Optional.h>
#include <folly/dynamic.h>
#include <folly/io/IOBuf.h>
namespace folly {
namespace bser {
-class BserDecodeError : public std::runtime_error {
+class FOLLY_EXPORT BserDecodeError : public std::runtime_error {
public:
using std::runtime_error::runtime_error;
};
#include <stdexcept>
+#include <folly/CPortability.h>
#include <folly/Range.h>
#include <folly/experimental/logging/LogConfig.h>
struct dynamic;
-class LogConfigParseError : public std::invalid_argument {
+class FOLLY_EXPORT LogConfigParseError : public std::invalid_argument {
public:
using std::invalid_argument::invalid_argument;
};
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#pragma once
-#include <folly/Function.h>
-#include <folly/Optional.h>
-#include <folly/fibers/detail/AtomicBatchDispatcher.h>
-#include <folly/futures/Future.h>
-#include <folly/futures/Promise.h>
#include <memory>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
+#include <folly/CPortability.h>
+#include <folly/Function.h>
+#include <folly/Optional.h>
+#include <folly/fibers/detail/AtomicBatchDispatcher.h>
+#include <folly/futures/Future.h>
+#include <folly/futures/Promise.h>
+
namespace folly {
namespace fibers {
* Examples are, multiple dispatch calls on the same token, trying to get more
* tokens from the dispatcher after commit has been called, etc.
*/
-class ABDUsageException : public std::logic_error {
+class FOLLY_EXPORT ABDUsageException : public std::logic_error {
using std::logic_error::logic_error;
};
* An exception class that gets set on the promise for dispatched tokens, when
* the AtomicBatchDispatcher was destroyed before commit was called on it.
*/
-class ABDCommitNotCalledException : public std::runtime_error {
+class FOLLY_EXPORT ABDCommitNotCalledException : public std::runtime_error {
public:
ABDCommitNotCalledException()
: std::runtime_error(
* Only here so that the caller can distinguish the real failure cause
* rather than these subsequently thrown exceptions.
*/
-class ABDTokenNotDispatchedException : public std::runtime_error {
+class FOLLY_EXPORT ABDTokenNotDispatchedException : public std::runtime_error {
using std::runtime_error::runtime_error;
};
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
#include <stdexcept>
#include <string>
+#include <folly/CPortability.h>
#include <folly/Range.h>
namespace folly {
-class AsyncSocketException : public std::runtime_error {
+class FOLLY_EXPORT AsyncSocketException : public std::runtime_error {
public:
enum AsyncSocketExceptionType {
UNKNOWN = 0,
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#include <folly/json.h>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/next_prior.hpp>
-#include <folly/Portability.h>
-#include <folly/lang/Bits.h>
#include <folly/Conv.h>
+#include <folly/Portability.h>
#include <folly/Range.h>
#include <folly/String.h>
#include <folly/Unicode.h>
+#include <folly/lang/Bits.h>
#include <folly/portability/Constexpr.h>
namespace folly {
//////////////////////////////////////////////////////////////////////
-struct ParseError : std::runtime_error {
+struct FOLLY_EXPORT ParseError : std::runtime_error {
explicit ParseError(
unsigned int line,
std::string const& context,
/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#pragma once
#include <algorithm>
#include <memory>
#include <system_error>
+#include <folly/CPortability.h>
#include <folly/CachelinePadded.h>
#include <folly/IndexedMemPool.h>
#include <folly/Likely.h>
/// The exception thrown when wait()ing on an isShutdown() LifoSem
-struct ShutdownSemError : public std::runtime_error {
+struct FOLLY_EXPORT ShutdownSemError : public std::runtime_error {
explicit ShutdownSemError(const std::string& msg);
~ShutdownSemError() noexcept override;
};