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

give all folly exception types default visibility

Summary: This makes sure that whether folly is statically or dynamically linked, all folly exception types will have exactly one definition, and one set of type information.

Reviewed By: mzlee

Differential Revision: D6671431

fbshipit-source-id: 1c06826a05f87cbf9af747c9abdb5f524744d054
parent 24f2ac23
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* /*
* AtomicHashMap -- * AtomicHashMap --
* *
...@@ -91,6 +90,7 @@ ...@@ -91,6 +90,7 @@
#include <stdexcept> #include <stdexcept>
#include <folly/AtomicHashArray.h> #include <folly/AtomicHashArray.h>
#include <folly/CPortability.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/ThreadCachedInt.h> #include <folly/ThreadCachedInt.h>
#include <folly/container/Foreach.h> #include <folly/container/Foreach.h>
...@@ -149,7 +149,7 @@ namespace folly { ...@@ -149,7 +149,7 @@ namespace folly {
// Thrown when insertion fails due to running out of space for // Thrown when insertion fails due to running out of space for
// submaps. // submaps.
struct AtomicHashMapFullError : std::runtime_error { struct FOLLY_EXPORT AtomicHashMapFullError : std::runtime_error {
explicit AtomicHashMapFullError() explicit AtomicHashMapFullError()
: std::runtime_error("AtomicHashMap is full") : std::runtime_error("AtomicHashMap is full")
{} {}
......
...@@ -162,7 +162,7 @@ auto fold(Fn&& fn, A&& a, B&& b, Bs&&... bs) { ...@@ -162,7 +162,7 @@ auto fold(Fn&& fn, A&& a, B&& b, Bs&&... bs) {
//! \endcode //! \endcode
class exception_wrapper final { class exception_wrapper final {
private: private:
struct AnyException : std::exception { struct FOLLY_EXPORT AnyException : std::exception {
std::type_info const* typeinfo_; std::type_info const* typeinfo_;
template <class T> template <class T>
/* implicit */ AnyException(T&& t) noexcept : typeinfo_(&typeid(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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/** /**
* Like folly::Optional, but can store a value *or* an error. * Like folly::Optional, but can store a value *or* an error.
* *
...@@ -31,6 +30,7 @@ ...@@ -31,6 +30,7 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/CPortability.h>
#include <folly/CppAttributes.h> #include <folly/CppAttributes.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Optional.h> #include <folly/Optional.h>
...@@ -660,7 +660,7 @@ inline expected_detail::UnexpectedTag unexpected( ...@@ -660,7 +660,7 @@ inline expected_detail::UnexpectedTag unexpected(
/** /**
* An exception type thrown by Expected on catastrophic logic errors. * 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: public:
BadExpectedAccess() : std::logic_error("bad Expected access") {} BadExpectedAccess() : std::logic_error("bad Expected access") {}
}; };
...@@ -689,7 +689,7 @@ class Unexpected final : ColdClass { ...@@ -689,7 +689,7 @@ class Unexpected final : ColdClass {
* when the user tries to access the nested value but the Expected object is * when the user tries to access the nested value but the Expected object is
* actually storing an error code. * actually storing an error code.
*/ */
class BadExpectedAccess : public folly::BadExpectedAccess { class FOLLY_EXPORT BadExpectedAccess : public folly::BadExpectedAccess {
public: public:
explicit BadExpectedAccess(Error err) explicit BadExpectedAccess(Error err)
: folly::BadExpectedAccess{}, error_(std::move(err)) {} : folly::BadExpectedAccess{}, error_(std::move(err)) {}
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <tuple> #include <tuple>
#include <type_traits> #include <type_traits>
#include <folly/CPortability.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/FormatArg.h> #include <folly/FormatArg.h>
#include <folly/Range.h> #include <folly/Range.h>
...@@ -318,7 +319,7 @@ inline std::string svformat(StringPiece fmt, Container&& container) { ...@@ -318,7 +319,7 @@ inline std::string svformat(StringPiece fmt, Container&& container) {
* makes the exception type small and noexcept-copyable like std::out_of_range, * makes the exception type small and noexcept-copyable like std::out_of_range,
* and therefore able to fit in-situ in exception_wrapper. * 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: public:
explicit FormatKeyNotFoundException(StringPiece key); explicit FormatKeyNotFoundException(StringPiece key);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <stdexcept> #include <stdexcept>
#include <folly/CPortability.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Portability.h> #include <folly/Portability.h>
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
namespace folly { namespace folly {
class BadFormatArg : public std::invalid_argument { class FOLLY_EXPORT BadFormatArg : public std::invalid_argument {
using invalid_argument::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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <exception> #include <exception>
#include <string> #include <string>
#include <utility> #include <utility>
#include <folly/CPortability.h>
#include <folly/detail/IPAddress.h> #include <folly/detail/IPAddress.h>
namespace folly { namespace folly {
...@@ -32,7 +32,7 @@ enum class IPAddressFormatError { INVALID_IP, UNSUPPORTED_ADDR_FAMILY }; ...@@ -32,7 +32,7 @@ enum class IPAddressFormatError { INVALID_IP, UNSUPPORTED_ADDR_FAMILY };
/** /**
* Exception for invalid IP addresses. * Exception for invalid IP addresses.
*/ */
class IPAddressFormatException : public std::exception { class FOLLY_EXPORT IPAddressFormatException : public std::exception {
public: public:
explicit IPAddressFormatException(std::string msg) noexcept explicit IPAddressFormatException(std::string msg) noexcept
: msg_(std::move(msg)) {} : msg_(std::move(msg)) {}
...@@ -51,7 +51,8 @@ class IPAddressFormatException : public std::exception { ...@@ -51,7 +51,8 @@ class IPAddressFormatException : public std::exception {
std::string msg_; std::string msg_;
}; };
class InvalidAddressFamilyException : public IPAddressFormatException { class FOLLY_EXPORT InvalidAddressFamilyException
: public IPAddressFormatException {
public: public:
explicit InvalidAddressFamilyException(std::string msg) noexcept explicit InvalidAddressFamilyException(std::string msg) noexcept
: IPAddressFormatException(std::move(msg)) {} : IPAddressFormatException(std::move(msg)) {}
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
/* /*
...@@ -87,7 +86,7 @@ typedef int detail::NoneHelper::*None; ...@@ -87,7 +86,7 @@ typedef int detail::NoneHelper::*None;
const None none = nullptr; const None none = nullptr;
class OptionalEmptyException : public std::runtime_error { class FOLLY_EXPORT OptionalEmptyException : public std::runtime_error {
public: public:
OptionalEmptyException() OptionalEmptyException()
: std::runtime_error("Empty Optional cannot be unwrapped") {} : std::runtime_error("Empty Optional cannot be unwrapped") {}
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <typeinfo> #include <typeinfo>
#include <utility> #include <utility>
#include <folly/CPortability.h>
#include <folly/CppAttributes.h> #include <folly/CppAttributes.h>
#include <folly/Traits.h> #include <folly/Traits.h>
#include <folly/detail/TypeList.h> #include <folly/detail/TypeList.h>
...@@ -175,7 +176,7 @@ struct PolyMembers {}; ...@@ -175,7 +176,7 @@ struct PolyMembers {};
/** /**
* Exception type that is thrown on invalid access of an empty `Poly` object. * 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; BadPolyAccess() = default;
char const* what() const noexcept override { char const* what() const noexcept override {
return "BadPolyAccess"; return "BadPolyAccess";
...@@ -186,7 +187,7 @@ struct BadPolyAccess : std::exception { ...@@ -186,7 +187,7 @@ struct BadPolyAccess : std::exception {
* Exception type that is thrown when attempting to extract from a `Poly` a * Exception type that is thrown when attempting to extract from a `Poly` a
* value of the wrong type. * value of the wrong type.
*/ */
struct BadPolyCast : std::bad_cast { struct FOLLY_EXPORT BadPolyCast : std::bad_cast {
BadPolyCast() = default; BadPolyCast() = default;
char const* what() const noexcept override { char const* what() const noexcept override {
return "BadPolyCast"; return "BadPolyCast";
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/** /**
* Subprocess library, modeled after Python's subprocess module * Subprocess library, modeled after Python's subprocess module
* (http://docs.python.org/2/library/subprocess.html) * (http://docs.python.org/2/library/subprocess.html)
...@@ -219,7 +218,7 @@ class ProcessReturnCode { ...@@ -219,7 +218,7 @@ class ProcessReturnCode {
/** /**
* Base exception thrown by the Subprocess methods. * Base exception thrown by the Subprocess methods.
*/ */
class SubprocessError : public std::runtime_error { class FOLLY_EXPORT SubprocessError : public std::runtime_error {
public: public:
using std::runtime_error::runtime_error; using std::runtime_error::runtime_error;
}; };
...@@ -227,7 +226,7 @@ class SubprocessError : public std::runtime_error { ...@@ -227,7 +226,7 @@ class SubprocessError : public std::runtime_error {
/** /**
* Exception thrown by *Checked methods of Subprocess. * Exception thrown by *Checked methods of Subprocess.
*/ */
class CalledProcessError : public SubprocessError { class FOLLY_EXPORT CalledProcessError : public SubprocessError {
public: public:
explicit CalledProcessError(ProcessReturnCode rc); explicit CalledProcessError(ProcessReturnCode rc);
~CalledProcessError() throw() override = default; ~CalledProcessError() throw() override = default;
...@@ -239,7 +238,7 @@ class CalledProcessError : public SubprocessError { ...@@ -239,7 +238,7 @@ class CalledProcessError : public SubprocessError {
/** /**
* Exception thrown if the subprocess cannot be started. * Exception thrown if the subprocess cannot be started.
*/ */
class SubprocessSpawnError : public SubprocessError { class FOLLY_EXPORT SubprocessSpawnError : public SubprocessError {
public: public:
SubprocessSpawnError(const char* executable, int errCode, int errnoValue); SubprocessSpawnError(const char* executable, int errCode, int errnoValue);
~SubprocessSpawnError() throw() override = default; ~SubprocessSpawnError() throw() override = default;
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <folly/ExceptionWrapper.h> #include <folly/ExceptionWrapper.h>
...@@ -29,12 +28,12 @@ ...@@ -29,12 +28,12 @@
namespace folly { namespace folly {
class TryException : public std::logic_error { class FOLLY_EXPORT TryException : public std::logic_error {
public: public:
using std::logic_error::logic_error; using std::logic_error::logic_error;
}; };
class UsingUninitializedTry : public TryException { class FOLLY_EXPORT UsingUninitializedTry : public TryException {
public: public:
UsingUninitializedTry() : TryException("Using uninitialized try") {} UsingUninitializedTry() : TryException("Using uninitialized try") {}
}; };
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <functional> #include <functional>
...@@ -21,6 +20,7 @@ ...@@ -21,6 +20,7 @@
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_facade.hpp> #include <boost/iterator/iterator_facade.hpp>
#include <folly/CPortability.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/Likely.h> #include <folly/Likely.h>
...@@ -76,7 +76,7 @@ struct hash<::folly::dynamic> { ...@@ -76,7 +76,7 @@ struct hash<::folly::dynamic> {
namespace folly { 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, dynamic::Type actual);
explicit TypeError( explicit TypeError(
const std::string& expected, const std::string& expected,
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <exception> #include <exception>
...@@ -21,6 +20,8 @@ ...@@ -21,6 +20,8 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/CPortability.h>
namespace folly { namespace folly {
// Some queue implementations (for example, LifoSemMPMCQueue or // Some queue implementations (for example, LifoSemMPMCQueue or
...@@ -28,7 +29,7 @@ namespace folly { ...@@ -28,7 +29,7 @@ namespace folly {
// non-blocking (THROW) behaviors. // non-blocking (THROW) behaviors.
enum class QueueBehaviorIfFull { THROW, BLOCK }; 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. 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
#pragma once #pragma once
#include <folly/CPortability.h>
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/dynamic.h> #include <folly/dynamic.h>
...@@ -194,7 +195,7 @@ std::string toPseudoJson(const folly::dynamic& d); ...@@ -194,7 +195,7 @@ std::string toPseudoJson(const folly::dynamic& d);
* With DynamicParser::OnError::THROW, reports the first error. * With DynamicParser::OnError::THROW, reports the first error.
* It is forbidden to call releaseErrors() if you catch this. * 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) explicit DynamicParserParseError(folly::dynamic error)
: std::runtime_error(folly::to<std::string>( : std::runtime_error(folly::to<std::string>(
"DynamicParserParseError: ", detail::toPseudoJson(error) "DynamicParserParseError: ", detail::toPseudoJson(error)
...@@ -217,7 +218,7 @@ struct DynamicParserParseError : public std::runtime_error { ...@@ -217,7 +218,7 @@ struct DynamicParserParseError : public std::runtime_error {
* instead of reporting an error via releaseErrors(). It is unsafe to call * instead of reporting an error via releaseErrors(). It is unsafe to call
* any parser methods after catching a LogicError. * any parser methods after catching a LogicError.
*/ */
struct DynamicParserLogicError : public std::logic_error { struct FOLLY_EXPORT DynamicParserLogicError : public std::logic_error {
template <typename... Args> template <typename... Args>
explicit DynamicParserLogicError(Args&&... args) explicit DynamicParserLogicError(Args&&... args)
: std::logic_error(folly::to<std::string>(std::forward<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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,15 +13,16 @@ ...@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <folly/Memory.h>
#include <map> #include <map>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include <folly/CPortability.h>
#include <folly/Memory.h>
namespace folly { namespace folly {
namespace experimental { namespace experimental {
...@@ -87,7 +88,7 @@ struct EnvironmentState { ...@@ -87,7 +88,7 @@ struct EnvironmentState {
EnvType env_; EnvType env_;
}; };
struct MalformedEnvironment : std::runtime_error { struct FOLLY_EXPORT MalformedEnvironment : std::runtime_error {
using std::runtime_error::runtime_error; using std::runtime_error::runtime_error;
}; };
} // namespace experimental } // namespace experimental
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/JSONSchema.h> #include <folly/experimental/JSONSchema.h>
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <folly/CPortability.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/Optional.h> #include <folly/Optional.h>
...@@ -33,8 +34,7 @@ namespace { ...@@ -33,8 +34,7 @@ namespace {
/** /**
* We throw this exception when schema validation fails. * We throw this exception when schema validation fails.
*/ */
struct SchemaError : std::runtime_error { struct FOLLY_EXPORT SchemaError : std::runtime_error {
SchemaError(SchemaError&&) = default; SchemaError(SchemaError&&) = default;
SchemaError(const 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <functional> #include <functional>
#include <stdexcept> #include <stdexcept>
#include <folly/CPortability.h>
#include <folly/experimental/ProgramOptions.h> #include <folly/experimental/ProgramOptions.h>
namespace folly { namespace folly {
...@@ -30,7 +30,7 @@ namespace folly { ...@@ -30,7 +30,7 @@ namespace folly {
* empty; the message is only allowed when exiting with a non-zero status), and * 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()) * 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: public:
explicit ProgramExit(int status, const std::string& msg = std::string()); explicit ProgramExit(int status, const std::string& msg = std::string());
int status() const { return status_; } int status() const { return status_; }
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <folly/CPortability.h>
#include <folly/Optional.h> #include <folly/Optional.h>
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <folly/io/IOBuf.h> #include <folly/io/IOBuf.h>
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
namespace folly { namespace folly {
namespace bser { namespace bser {
class BserDecodeError : public std::runtime_error { class FOLLY_EXPORT BserDecodeError : public std::runtime_error {
public: public:
using std::runtime_error::runtime_error; using std::runtime_error::runtime_error;
}; };
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <stdexcept> #include <stdexcept>
#include <folly/CPortability.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/LogConfig.h> #include <folly/experimental/logging/LogConfig.h>
...@@ -34,7 +35,7 @@ namespace folly { ...@@ -34,7 +35,7 @@ namespace folly {
struct dynamic; struct dynamic;
class LogConfigParseError : public std::invalid_argument { class FOLLY_EXPORT LogConfigParseError : public std::invalid_argument {
public: public:
using std::invalid_argument::invalid_argument; 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -15,17 +15,19 @@ ...@@ -15,17 +15,19 @@
*/ */
#pragma once #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 <memory>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #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 folly {
namespace fibers { namespace fibers {
...@@ -35,7 +37,7 @@ namespace fibers { ...@@ -35,7 +37,7 @@ namespace fibers {
* Examples are, multiple dispatch calls on the same token, trying to get more * Examples are, multiple dispatch calls on the same token, trying to get more
* tokens from the dispatcher after commit has been called, etc. * 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; using std::logic_error::logic_error;
}; };
...@@ -43,7 +45,7 @@ class ABDUsageException : public std::logic_error { ...@@ -43,7 +45,7 @@ class ABDUsageException : public std::logic_error {
* An exception class that gets set on the promise for dispatched tokens, when * An exception class that gets set on the promise for dispatched tokens, when
* the AtomicBatchDispatcher was destroyed before commit was called on it. * 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: public:
ABDCommitNotCalledException() ABDCommitNotCalledException()
: std::runtime_error( : std::runtime_error(
...@@ -57,7 +59,7 @@ class ABDCommitNotCalledException : public std::runtime_error { ...@@ -57,7 +59,7 @@ class ABDCommitNotCalledException : public std::runtime_error {
* Only here so that the caller can distinguish the real failure cause * Only here so that the caller can distinguish the real failure cause
* rather than these subsequently thrown exceptions. * 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; 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,17 +13,17 @@ ...@@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <folly/CPortability.h>
#include <folly/Range.h> #include <folly/Range.h>
namespace folly { namespace folly {
class AsyncSocketException : public std::runtime_error { class FOLLY_EXPORT AsyncSocketException : public std::runtime_error {
public: public:
enum AsyncSocketExceptionType { enum AsyncSocketExceptionType {
UNKNOWN = 0, UNKNOWN = 0,
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/json.h> #include <folly/json.h>
#include <algorithm> #include <algorithm>
...@@ -22,13 +21,13 @@ ...@@ -22,13 +21,13 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/next_prior.hpp> #include <boost/next_prior.hpp>
#include <folly/Portability.h>
#include <folly/lang/Bits.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Portability.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/Unicode.h> #include <folly/Unicode.h>
#include <folly/lang/Bits.h>
#include <folly/portability/Constexpr.h> #include <folly/portability/Constexpr.h>
namespace folly { namespace folly {
...@@ -187,7 +186,7 @@ struct Printer { ...@@ -187,7 +186,7 @@ struct Printer {
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
struct ParseError : std::runtime_error { struct FOLLY_EXPORT ParseError : std::runtime_error {
explicit ParseError( explicit ParseError(
unsigned int line, unsigned int line,
std::string const& context, std::string const& context,
......
/* /*
* Copyright 2017 Facebook, Inc. * Copyright 2017-present Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once #pragma once
#include <algorithm> #include <algorithm>
...@@ -23,6 +22,7 @@ ...@@ -23,6 +22,7 @@
#include <memory> #include <memory>
#include <system_error> #include <system_error>
#include <folly/CPortability.h>
#include <folly/CachelinePadded.h> #include <folly/CachelinePadded.h>
#include <folly/IndexedMemPool.h> #include <folly/IndexedMemPool.h>
#include <folly/Likely.h> #include <folly/Likely.h>
...@@ -90,7 +90,7 @@ typedef LifoSemImpl<> LifoSem; ...@@ -90,7 +90,7 @@ typedef LifoSemImpl<> LifoSem;
/// The exception thrown when wait()ing on an isShutdown() LifoSem /// 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); explicit ShutdownSemError(const std::string& msg);
~ShutdownSemError() noexcept override; ~ShutdownSemError() noexcept override;
}; };
......
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