Files
react-native/ReactCommon/hermes/inspector/Exceptions.h
T
Martin Sherburn 549563e8ab Allow Hermes to be built as a DLL on Windows
Summary:
On windows it is required to explicitly specify what symbols need to be exported from a DLL to make them accessible (using `__declspec(dllexport)`). I have added and expanded on existing macros to do this and added exports that were previously missing.

Changelog:
[Internal][Changed] - Allow Hermes to be compiled to a single DLL on windows

Reviewed By: mhorowitz

Differential Revision: D23084343

fbshipit-source-id: 832cb17b9e637e4c04dad479aae6c1fc190f968e
2020-08-24 06:07:19 -07:00

55 lines
1.5 KiB
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// using include guards instead of #pragma once due to compile issues
// with MSVC and BUCK
#ifndef HERMES_INSPECTOR_EXCEPTIONS_H
#define HERMES_INSPECTOR_EXCEPTIONS_H
#include <stdexcept>
namespace facebook {
namespace hermes {
namespace inspector {
class AlreadyEnabledException : public std::runtime_error {
public:
AlreadyEnabledException()
: std::runtime_error("can't enable: debugger already enabled") {}
};
class NotEnabledException : public std::runtime_error {
public:
NotEnabledException(const std::string &cmd)
: std::runtime_error("debugger can't perform " + cmd + ": not enabled") {}
};
class InvalidStateException : public std::runtime_error {
public:
InvalidStateException(
const std::string &cmd,
const std::string &curState,
const std::string &expectedState)
: std::runtime_error(
"debugger can't perform " + cmd + ": in " + curState +
", expected " + expectedState) {}
};
class MultipleCommandsPendingException : public std::runtime_error {
public:
MultipleCommandsPendingException(const std::string &cmd)
: std::runtime_error(
"debugger can't perform " + cmd +
": a step or resume is already pending") {}
};
} // namespace inspector
} // namespace hermes
} // namespace facebook
#endif // HERMES_INSPECTOR_EXCEPTIONS_H