Skip to content

Commit

Permalink
fix: avoid directly exporting Ably.ErrorInfo from promises.js
Browse files Browse the repository at this point in the history
  • Loading branch information
owenpearson committed Oct 17, 2023
1 parent 83b4516 commit 311726e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};
Expand All @@ -23,7 +27,7 @@ var RealtimePromise = function (options) {
Object.assign(RealtimePromise, Ably.Realtime);

module.exports = {
ErrorInfo: Ably.ErrorInfo,
ErrorInfo: ErrorInfo,
Rest: RestPromise,
Realtime: RealtimePromise,
};

0 comments on commit 311726e

Please sign in to comment.