From d95e81b17dd698a947fb09d402d4e282d6c54c79 Mon Sep 17 00:00:00 2001 From: John Knox Date: Thu, 14 Feb 2019 09:50:55 -0800 Subject: [PATCH] Deprecate client.send() Summary: Adds a warning when not in production and client.send() is used. We could just delete it but there may be open source users of the API. Reviewed By: passy Differential Revision: D14085002 fbshipit-source-id: 39f965b59540bd5b7059ec8d6b1c274146699d2d --- src/Client.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Client.js b/src/Client.js index a1a43d7bc..77359bba2 100644 --- a/src/Client.js +++ b/src/Client.js @@ -454,6 +454,12 @@ export default class Client extends EventEmitter { } send(api: string, method: string, params?: Object): void { + if (!isProduction()) { + console.warn( + `${api}:${method || + ''} client.send() is deprecated. Please use call() instead so you can handle errors.`, + ); + } return this.rawSend('execute', {api, method, params}); } }