@salesforce/core 8.18.3 → 8.18.4

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.
@@ -48,6 +48,9 @@ const validateScratchOrgInfoForResume = async ({ jobId, hubOrg, cache, hubUserna
48
48
  if (['New', 'Creating'].includes(scratchOrgInfo.Status)) {
49
49
  // 2. scratchOrgInfo exists, still isn't finished. Stays in cache for future attempts
50
50
  const logger = await logger_1.Logger.child('scratchOrgResume');
51
+ if (timeout.minutes === 0) {
52
+ throw namedMessages.createError('StillInProgressError', [scratchOrgInfo.Status], ['action.StillInProgress']);
53
+ }
51
54
  logger.debug(`PollingTimeout in minutes: ${timeout.minutes}`);
52
55
  const options = {
53
56
  async poll() {
@@ -79,8 +82,17 @@ const validateScratchOrgInfoForResume = async ({ jobId, hubOrg, cache, hubUserna
79
82
  timeout,
80
83
  };
81
84
  const client = await pollingClient_1.PollingClient.create(options);
82
- const result = await client.subscribe();
83
- return (0, exports.checkScratchOrgInfoForErrors)(result, hubUsername);
85
+ try {
86
+ const result = await client.subscribe();
87
+ return await (0, exports.checkScratchOrgInfoForErrors)(result, hubUsername);
88
+ }
89
+ catch (error) {
90
+ const e = error;
91
+ if (e.name === 'ScratchOrgResumeTimeOutError') {
92
+ e.message = e.message + ` (Last known Status: ${scratchOrgInfo.Status})`;
93
+ }
94
+ throw error;
95
+ }
84
96
  }
85
97
  return (0, exports.checkScratchOrgInfoForErrors)(scratchOrgInfo, hubUsername);
86
98
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "8.18.3",
3
+ "version": "8.18.4",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",