@certik/skynet 0.10.32 → 0.10.33

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.33
4
+
5
+ - Fixed api monitor error messages
6
+
3
7
  ## 0.10.32
4
8
 
5
9
  - Changed deploy to add a SKYNET_DEPLOYED_AT variable to ensure new deployment would always be triggered in nomad
package/app.js CHANGED
@@ -609,13 +609,22 @@ function api({ name, routes, serve, beforeListen, env = {}, region = "us-east-1"
609
609
  func: async () => {
610
610
  const errors = [];
611
611
 
612
- const url = `http://localhost:9999${serve.prefix}/`;
613
- const res = await fetch(url);
612
+ try {
613
+ const url = `http://localhost:9999${serve.prefix}/`;
614
+ const res = await fetch(url);
615
+
616
+ if (!res.ok) {
617
+ errors.push({
618
+ type: ERROR_LEVEL.ERROR,
619
+ message: `service ${name} is unhealthy`,
620
+ });
621
+ }
622
+ } catch (fetchErr) {
623
+ console.log(`error fetching ${url}`, fetchErr);
614
624
 
615
- if (!res.ok) {
616
625
  errors.push({
617
626
  type: ERROR_LEVEL.ERROR,
618
- message: `service ${name} is not healthy`,
627
+ message: `service ${name} is unhealthy`,
619
628
  });
620
629
  }
621
630
 
package/monitor.js CHANGED
@@ -132,7 +132,7 @@ ${
132
132
  } catch (err) {
133
133
  console.log(`[MONITOR] got error in check`, err);
134
134
 
135
- return [`${err.message}`];
135
+ return [{ type: ERROR_LEVEL.ERROR, message: `${err.message}` }];
136
136
  }
137
137
  },
138
138
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.10.32",
3
+ "version": "0.10.33",
4
4
  "description": "Skynet Shared JS library",
5
5
  "main": "index.js",
6
6
  "author": "CertiK Engineering",