screwdriver-api 4.1.229 → 4.1.232

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": "screwdriver-api",
3
- "version": "4.1.229",
3
+ "version": "4.1.232",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -167,7 +167,9 @@ module.exports = () => ({
167
167
  ...scmConfig
168
168
  }),
169
169
  scm.getPrInfo(scmConfig)
170
- ]);
170
+ ]).catch(err => {
171
+ throw boom.boomify(err, { statusCode: err.statusCode });
172
+ });
171
173
 
172
174
  if (files && files.length) {
173
175
  payload.changedFiles = files;
@@ -54,6 +54,10 @@ module.exports = () => ({
54
54
  );
55
55
  }
56
56
  })
57
+ .catch(error => {
58
+ // 404 error throws, if branch name is incorrect
59
+ throw boom.boomify(error, { statusCode: error.statusCode });
60
+ })
57
61
  .then(() => {
58
62
  let scmUrl = checkoutUrl;
59
63
 
@@ -64,7 +64,7 @@ module.exports = () => ({
64
64
  return Promise.resolve(null);
65
65
  }
66
66
 
67
- throw error;
67
+ throw boom.boomify(error, { statusCode: error.statusCode });
68
68
  })
69
69
  // user has good permissions, remove the pipeline
70
70
  .then(() => pipeline.remove())
@@ -46,7 +46,9 @@ module.exports = () => ({
46
46
  const scmUri = await getScmUri({ pipeline, pipelineFactory });
47
47
 
48
48
  // Check the user's permission
49
- const permissions = await user.getPermissions(scmUri);
49
+ const permissions = await user.getPermissions(scmUri).catch(error => {
50
+ throw boom.boomify(error, { statusCode: error.statusCode });
51
+ });
50
52
 
51
53
  // check if user has push access
52
54
  if (!permissions.push) {