From 2290a4935401590353360cd9af16c6d6ac904ae4 Mon Sep 17 00:00:00 2001 From: RiskoZoSlovenska Date: Wed, 6 Dec 2023 20:27:15 -0500 Subject: [PATCH] Don't store a client option in the API class --- libs/client/API.lua | 5 ++--- libs/client/Client.lua | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/client/API.lua b/libs/client/API.lua index 0c1afe54..f33f0d92 100644 --- a/libs/client/API.lua +++ b/libs/client/API.lua @@ -113,10 +113,9 @@ end local API = require('class')('API') -function API:__init(client, logFullErrors) +function API:__init(client) self._client = client self._mutexes = setmetatable({}, mutexMeta) - self._logFullErrors = logFullErrors end function API:authenticate(token) @@ -238,7 +237,7 @@ function API:commit(method, url, req, payload, retries) end local errMsg = f('%i - %s : %s %s', res.code, res.reason, method, url) - if self._logFullErrors then + if options.logFullErrors then errMsg = errMsg .. "\n" .. msg end client:error(errMsg) diff --git a/libs/client/Client.lua b/libs/client/Client.lua index 8322028b..dcf47ce8 100644 --- a/libs/client/Client.lua +++ b/libs/client/Client.lua @@ -108,7 +108,7 @@ function Client:__init(options) options = assert(parseOptions(options)) self._options = options self._shards = {} - self._api = API(self, options.logFullErrors) + self._api = API(self) self._mutex = Mutex() self._users = Cache({}, User, self) self._guilds = Cache({}, Guild, self)