Skip to content

Commit 9c823d5

Browse files
committed
fix sandbox auth aws error handling
1 parent 49e83ad commit 9c823d5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/sandbox_auth.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ get_user_command_output=$(aws cognito-idp admin-get-user --user-pool-id "$cognit
2222
get_user_command_exit_code=$?
2323
set -e #re-enable
2424

25+
if [[ $get_user_command_exit_code -ne 0 ]]; then
26+
if ! echo "$get_user_command_output" | grep -q "UserNotFoundException"; then
27+
echo "$get_user_command_output" >&2
28+
exit $get_user_command_exit_code
29+
fi
30+
fi
31+
2532
function gen_temp_password() {
2633
upper=$(LC_ALL=C tr -dc 'A-Z' </dev/urandom | head -c 4; echo)
2734
lower=$(LC_ALL=C tr -dc 'a-z' </dev/urandom | head -c 4; echo)

0 commit comments

Comments
 (0)