@leofcoin/workers 1.3.12 → 1.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/workers",
3
- "version": "1.3.12",
3
+ "version": "1.3.13",
4
4
  "description": "Workers used in @leofcoin/chain",
5
5
  "type": "module",
6
6
  "exports": {
package/src/log-worker.ts CHANGED
@@ -23,7 +23,7 @@ declare type messageReturn = {
23
23
 
24
24
  const handlePut = async message => {
25
25
  try {
26
- await fetch(`http://localhost:8080/log/put`, {
26
+ await fetch(`http://localhost:8844/log/put`, {
27
27
  method: 'put',
28
28
  body: message
29
29
  })
@@ -34,7 +34,7 @@ const handlePut = async message => {
34
34
 
35
35
  const handleGet = async message => {
36
36
  try {
37
- await fetch(`http://localhost:8080/log/get?`, {
37
+ await fetch(`http://localhost:8844/log/get?`, {
38
38
  method: 'put',
39
39
  body: message
40
40
  })
@@ -67,7 +67,15 @@ const execute = async (contract, method, params) => {
67
67
  // state.put(result)
68
68
  return result
69
69
  } catch (e) {
70
- throw e
70
+ throw new Error(
71
+ `
72
+ error: ${e}
73
+
74
+ contract: ${contract}
75
+ method: ${method}
76
+ params: ${JSON.stringify(params, null, '\t')}
77
+ `
78
+ )
71
79
  }
72
80
  }
73
81