Cleanup - centralize the log handling
This commit is contained in:
@@ -9,11 +9,8 @@ curl -s -X POST https://api.schwabapi.com/v1/oauth/token \
|
||||
-d "grant_type=refresh_token&refresh_token=$(<refresh_token.dat)" > temp/accessTokenReqResp.$$.json
|
||||
jq -e -r .access_token temp/accessTokenReqResp.$$.json > access_token.dat
|
||||
if [[ $? -ne 0 ]]; then
|
||||
errMsg="ERROR: GETTING THE ACCESS TOKEN FAILED! $(<temp/accessTokenReqResp.$$.json)"
|
||||
systemd-cat -t "`basename $0`" -p err <<< ${errMsg}
|
||||
>&2 echo "${errMsg}"
|
||||
curl -d "" -X POST "https://deadswitch.kawomi.com/api/v1?topic=trade.schwab.error.getNewAccessToken&secs=1&email=joe@kawomi.com"
|
||||
exit 1
|
||||
throw "ERROR: GETTING THE ACCESS TOKEN FAILED! $(<temp/accessTokenReqResp.$$.json)" err
|
||||
fi
|
||||
#echo Access Token: $(<access_token.dat)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user