From 311726e7c5ff2a87aec792f9f4eb9fa960666791 Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Tue, 17 Oct 2023 15:41:13 +0100 Subject: [PATCH] fix: avoid directly exporting Ably.ErrorInfo from promises.js --- promises.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/promises.js b/promises.js index fa1fb81592..efb1645a40 100644 --- a/promises.js +++ b/promises.js @@ -12,6 +12,10 @@ function promisifyOptions(options) { // eslint-disable-next-line @typescript-eslint/no-var-requires var Ably = require('./build/ably-node'); +var ErrorInfo = function(message, code, statusCode, cause) { + return new Ably.ErrorInfo(message, code, statusCode, cause); +} + var RestPromise = function (options) { return new Ably.Rest(promisifyOptions(options)); }; @@ -23,7 +27,7 @@ var RealtimePromise = function (options) { Object.assign(RealtimePromise, Ably.Realtime); module.exports = { - ErrorInfo: Ably.ErrorInfo, + ErrorInfo: ErrorInfo, Rest: RestPromise, Realtime: RealtimePromise, };