Skip to content

Commit

Permalink
better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Aug 17, 2020
1 parent eb5052a commit b8ceddc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ AWS.SingleSignOnCredentials = AWS.util.inherit(AWS.Credentials, {
roleName: profile.sso_role_name,
};
if (!request) {
console.log(
`Cached credentials not found under ${cachePath}. Please make sure you log in with 'aws sso login' first`
throw AWS.util.error(
new Error(
`Cached credentials not found under ${cachePath}. Please make sure you log in with 'aws sso login' first`
)
);
}
sso.getRoleCredentials(request, (err, c) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mhlabs/aws-sdk-sso",
"version": "0.0.6",
"version": "0.0.7",
"description": "Credentials provider for AWS Single Sign-On",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b8ceddc

Please sign in to comment.