Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions schemas/org-create-sandbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"SandboxUsername": {
"type": "string"
},
"Message": {
"type": "string"
},
"Id": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions schemas/org-refresh-sandbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"SandboxUsername": {
"type": "string"
},
"Message": {
"type": "string"
},
"Id": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions schemas/org-resume-sandbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"SandboxUsername": {
"type": "string"
},
"Message": {
"type": "string"
},
"Id": {
"type": "string"
},
Expand Down
14 changes: 11 additions & 3 deletions src/commands/org/resume/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,25 @@ export default class ResumeSandbox extends SandboxCommandBase<SandboxCommandResp
});
return this.getSandboxCommandResponse();
} catch (err) {
const errMessage = err instanceof Error ? err.message : String(err);

if (this.latestSandboxProgressObj && this.pollingTimeOut) {
void lifecycle.emit(SandboxEvents.EVENT_ASYNC_RESULT, undefined);
process.exitCode = 68;
return this.latestSandboxProgressObj;
const response = this.getSandboxCommandResponse();
response.Message = errMessage;
return response;
} else if (
this.latestSandboxProgressObj &&
err instanceof SfError &&
err.name === 'SandboxCreateNotCompleteError'
['SandboxCreateNotCompleteError', 'SandboxAuthNotCompleteError', 'SandboxAuthIncompleteError'].includes(
err.name
)
) {
process.exitCode = 68;
return this.latestSandboxProgressObj;
const response = this.getSandboxCommandResponse();
response.Message = errMessage;
return response;
}
throw err;
}
Expand Down
1 change: 1 addition & 0 deletions src/shared/sandboxCommandBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const messages = Messages.loadMessages('@salesforce/plugin-org', 'sandboxbase');

export type SandboxCommandResponse = SandboxProcessObject & {
SandboxUsername?: string;
Message?: string;
};

export abstract class SandboxCommandBase<T> extends SfCommand<T> {
Expand Down
Loading