screwdriver-api 7.0.100 → 7.0.102

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": "7.0.100",
3
+ "version": "7.0.102",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -46,7 +46,17 @@ module.exports = () => ({
46
46
  }
47
47
 
48
48
  // Check permissions
49
- const permissions = await user.getPermissions(pipeline.scmUri);
49
+ let permissions;
50
+
51
+ try {
52
+ permissions = await user.getPermissions(pipeline.scmUri);
53
+ } catch (err) {
54
+ if (err.statusCode === 403 && pipeline.scmRepo && pipeline.scmRepo.private) {
55
+ throw boom.notFound();
56
+ }
57
+ throw boom.boomify(err, { statusCode: err.statusCode });
58
+ }
59
+
50
60
  const adminDetails = request.server.plugins.banners.screwdriverAdminDetails(
51
61
  username,
52
62
  scmContext,