Files
flipper/xplat/Flipper/FlipperResponder.h
John Knox ff076d9dcd FlipperResponder: no response = success
Summary:
If an exception is thrown from the plugin, FlipperClient.cpp will catch it and respond with an error response.
If the object goes out of scope with no response being returned, then return a success response in the destructor.

Reviewed By: passy

Differential Revision: D14024259

fbshipit-source-id: 52e419dd23fc3882e8b92b593e8c1e1ea90e2b26
2019-02-13 05:13:42 -08:00

35 lines
784 B
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 <folly/json.h>
namespace facebook {
namespace flipper {
/**
* FlipperResponder is used to asynchronously respond to messages
* received from the Flipper desktop app.
*/
class FlipperResponder {
public:
virtual ~FlipperResponder(){};
/**
* Deliver a successful response to the Flipper desktop app.
*/
virtual void success(const folly::dynamic& response) = 0;
/**
* Inform the Flipper desktop app of an error in handling the request.
*/
virtual void error(const folly::dynamic& response) = 0;
};
} // namespace flipper
} // namespace facebook