magmastream 2.10.1-dev.2 → 2.10.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,16 +106,15 @@ class Rest {
106
106
  timeout: this.node.options.apiRequestTimeoutMs,
107
107
  validateStatus: () => true,
108
108
  };
109
- let response;
109
+ let response = null;
110
110
  try {
111
111
  response = await (0, axios_1.default)(config);
112
112
  }
113
- catch (err) {
114
- const message = err instanceof Error ? err.message : "Unknown error";
115
- throw new MagmastreamError_1.MagmaStreamError({
116
- code: Enums_1.MagmaStreamErrorCode.REST_REQUEST_FAILED,
117
- message: `No response from node ${this.node.options.identifier}: ${message}`,
118
- });
113
+ catch (e) {
114
+ const isTimeout = axios_1.default.isAxiosError(e) && e.code === "ECONNABORTED";
115
+ const message = e instanceof Error ? e.message : "Unknown error";
116
+ this.manager.emit(Enums_1.ManagerEventTypes.NodeError, this.node, new Error(`${isTimeout ? "Timeout" : "Network error"} on ${method} ${endpoint}: ${message}`));
117
+ return null;
119
118
  }
120
119
  const { status, data } = response;
121
120
  if (status >= 200 && status < 300) {
@@ -244,7 +244,7 @@ export interface VoiceServerUpdate {
244
244
  */
245
245
  export interface RedisConfig {
246
246
  host: string;
247
- port: string;
247
+ port: number;
248
248
  password?: string;
249
249
  db?: number;
250
250
  prefix?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.10.1-dev.2",
3
+ "version": "2.10.2-alpha.0",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,8 @@
16
16
  "lint": "eslint \"src/**/*.{ts,js}\"",
17
17
  "lint:fix": "eslint --fix \"src/**/*.{ts,js}\"",
18
18
  "ci": "run-s format:check lint build types",
19
- "release:dev": "npm run format && npm run lint:fix && npm run ci && npm version prerelease --preid=dev && git push && npm publish --tag dev"
19
+ "release:alpha": "npm run format && npm run lint:fix && npm run ci && npm version prerelease --preid=alpha && npm publish --tag alpha && git push && git push --tags",
20
+ "release:dev": "npm run format && npm run lint:fix && npm run ci && npm version prerelease --preid=dev && npm publish --tag dev && git push && git push --tags"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@favware/rollup-type-bundler": "^4.0.0",