@ekhein/sekiro-node-client 2.1.12 → 2.1.13

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.
Files changed (2) hide show
  1. package/dist/main.js +10 -4
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -28,10 +28,16 @@ class SekiroClient extends ws_util_1.W3CWebSocket {
28
28
  if (!handler)
29
29
  throw new Error("Handler Not Found");
30
30
  const body = await handler.call(this, request.params);
31
- const pack = body.jsonrpc
32
- ? result_util_1.Result.success(request, body.result)
33
- : result_util_1.Result.success(request, body);
34
- this.send(pack);
31
+ if (body?.jsonrpc) {
32
+ if (body.error)
33
+ throw new Error(body.error.message);
34
+ const pack = result_util_1.Result.success(request, body.result);
35
+ this.send(pack);
36
+ }
37
+ else {
38
+ const pack = result_util_1.Result.success(request, body);
39
+ this.send(pack);
40
+ }
35
41
  }
36
42
  catch (error) {
37
43
  const pack = result_util_1.Result.unknown(request, error.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekhein/sekiro-node-client",
3
- "version": "2.1.12",
3
+ "version": "2.1.13",
4
4
  "license": "MIT",
5
5
  "author": "ekhein",
6
6
  "main": "./dist/main.js",