@social-mail/social-mail-web-server 1.8.371 → 1.8.372

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": "@social-mail/social-mail-web-server",
3
- "version": "1.8.371",
3
+ "version": "1.8.372",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/WebServer.ts CHANGED
@@ -228,6 +228,10 @@ export default class WebServer {
228
228
  return server;
229
229
  } catch (error) {
230
230
  console.error(error);
231
+ // if create fails...
232
+ // we need to kill the current process
233
+ // we will throw this error again
234
+ throw error;
231
235
  }
232
236
  }
233
237
 
@@ -4,6 +4,7 @@ import { existsSync, mkdirSync, unlinkSync, statSync, utimesSync, writeFileSync
4
4
  import { createHash } from "node:crypto";
5
5
  import sleep from "../../common/sleep.js";
6
6
  import { globalEnv } from "../../common/globalEnv.js";
7
+ import TimeoutError from "../../common/errors/TimeoutError.js";
7
8
 
8
9
  const tmpdir = globalEnv.tmpDir;
9
10
 
@@ -56,7 +57,8 @@ export default class LockFile implements Disposable {
56
57
  }while(now < till);
57
58
 
58
59
  if (throwOnFail) {
59
- throw new Error(`Could not acquire lock ${lastError?.stack ?? lastError?.toString()}`);
60
+ lastError ??= new TimeoutError("lock timed out");
61
+ throw new Error(`Could not acquire lock ${lockFile}, Reason: ${lastError?.stack ?? lastError?.toString()}`);
60
62
  }
61
63
 
62
64
  return {