This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

50 lines
1.3 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.
*/
#pragma once
#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