Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit c6d6928

Browse files
committed
error reporting fixes
1 parent e6e98df commit c6d6928

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

lib/jobs/artifactsList.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function artifactsList(params, cb) {
4040
params.jobId = projectConfig.getLastJobId(null, params.jobId);
4141
return method(artifactsList, params, function artifactsListCb(err, data) {
4242
if (global.paperspace_cli && !json) {
43+
if (err) return cb(err);
4344
if (data && data.length) {
4445
data.forEach(function itemFunc(item) {
4546
if (item.file) {
@@ -50,7 +51,8 @@ function artifactsList(params, cb) {
5051
}
5152
});
5253
}
53-
} else return cb(null, data);
54+
return cb();
55+
} else return cb(err, data);
5456
});
5557
}
5658

lib/jobs/create.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ function create(params, cb) {
183183
}
184184
}
185185

186+
if (params.container && typeof params.container !== 'string') return ifCliPrintErrorOnly(new Error('Parameter `container` expected to be a string'));
187+
if (params.workspace && typeof params.workspace !== 'string') return ifCliPrintErrorOnly(new Error('Parameter `workspace` expected to be a string'));
188+
186189
if (params.machineType) projectConfig.setMachineType(params.project, params.machineType);
187190
else params.machineType = projectConfig.getMachineType();
188191

lib/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function request(
108108
console.error('res: ' + res);
109109
body = {};
110110
}
111-
} else if (res.body) { // res.body is expected to be text/json
111+
} else if (res && res.body) { // res.body is expected to be text/json
112112
body = res.body;
113113
} else body = {};
114114

0 commit comments

Comments
 (0)