Skip to content

Commit 6da9d8d

Browse files
committed
fix(credentials) better handling if credential providers fail
All error were previously recorded as "not implemented"
1 parent e2a3f4c commit 6da9d8d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ Release process:
145145
1. test installing the rock from LuaRocks
146146

147147

148+
### 0.5.2 (unreleased)
149+
150+
- fix: better error handling when credential providers fail to load
151+
148152
### 0.5.1 (01-Jun-2022)
149153

150154
- feat: socket compatibility; overriding luasocket use in phases now returns

src/resty/aws/init.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,14 @@ function AWS:new(config)
480480
return creds, err
481481
end
482482
else
483-
-- not implemented yet
484-
aws_instance[class_name] = function(self, opts)
485-
error(("'%s' hasn't been implemented yet"):format(class_name), 2)
483+
if cred_class:find("module 'resty.aws.credentials." .. class_name .. "' not found", 1, true) then
484+
-- not implemented yet
485+
aws_instance[class_name] = function(self, opts)
486+
error(("'%s' hasn't been implemented yet"):format(class_name), 2)
487+
end
488+
else
489+
-- some other error, bail out
490+
error(cred_class)
486491
end
487492
end
488493
end

0 commit comments

Comments
 (0)