Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Commit

Permalink
empty catch statements don't resolve, breaking behavior if can't crea…
Browse files Browse the repository at this point in the history
…te orphan
  • Loading branch information
Chris Pauley committed Oct 2, 2017
1 parent 4b49ff0 commit 3e276bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/Authentication/Token/Token.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,13 @@ export default class TokenAuthBackend extends React.Component {
// User doesnt have sudo, use user assigned policies
let p1 = callVaultApi('get', 'auth/token/lookup-self').then((resp) => {
this.setState({ newTokenAvailablePolicies: resp.data.data.policies });
}).catch(); // <- This shouldnt have failed
}).catch(() => {}); // <- This shouldnt have failed

// Altough sudo was not granted, we could still create orphans using a different endpoint
let p2 = tokenHasCapabilities(['update'], 'auth/token/create-orphan').then(() => {
// Turns out we can
this.setState({ 'canCreateOrphan': 'create_orphan' });
}).catch(); // <- Nothing we can really do at this point
}).catch(() => {}); // <- Nothing we can really do at this point

return Promise.all([p1, p2]);
});
Expand Down

0 comments on commit 3e276bc

Please sign in to comment.