godprotocol 1.2.12 → 1.2.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/html/index.js +16 -11
  2. package/package.json +1 -1
package/html/index.js CHANGED
@@ -22,18 +22,23 @@ const header_script = (manager)=>{
22
22
  let domain = manager.options.server_domain
23
23
  if (domain.startsWith('127')) domain = `http://${domain}`
24
24
  else domain = `https://${domain}`
25
-
25
+
26
26
  return ` let ftch = async(path, body)=>{
27
- let fch = await fetch("${domain}".concat(path), {
28
- method: 'POST',
29
- header: {
30
- 'Content-Type': 'application/json',
31
- Accept: 'application/json'
32
- },
33
- body: JSON.stringify(body)
34
- })
35
- let response = await fch.json()
36
- return response;
27
+ try{
28
+ let fch = await fetch("${domain}".concat(path), {
29
+ method: 'POST',
30
+ header: {
31
+ 'Content-Type': 'application/json',
32
+ Accept: 'application/json'
33
+ },
34
+ body: JSON.stringify(body)
35
+ })
36
+ let response = await fch.json()
37
+ return response;
38
+ }catch(e){
39
+ console.log(e)
40
+ return {message: e.message}
41
+ }
37
42
  }`
38
43
  }
39
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godprotocol",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "A distributed computing environment",
5
5
  "main": "Index.js",
6
6
  "scripts": {