diff --git a/index.js b/index.js index 63c5e5b..43499dc 100644 --- a/index.js +++ b/index.js @@ -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) => { diff --git a/package.json b/package.json index f61b870..f304d20 100644 --- a/package.json +++ b/package.json @@ -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": {