Cleanup - centralize the log handling

This commit is contained in:
2024-08-27 12:16:01 -05:00
parent d8891ec75f
commit a6b7fc7afe
15 changed files with 124 additions and 180 deletions

View File

@@ -1,5 +1,6 @@
#!/bin/bash
#set -x
. helpers.sh
symbol=$1
outDir=data/$(date +%Y-%m-%d)
@@ -13,9 +14,7 @@ jqQuery=".\"${symbol}\".symbol"
symbolCheck=$(jq -r ${jqQuery} < temp/quote.${symbol}.tmp.$$.json)
if [[ "${symbol}" != "${symbolCheck}" ]]; then
errMsg="ERROR: THE RESPONSE IS INCORRECT! Symbol: _${symbol}_ Check: _${symbolCheck}_ check file _temp/quote.${symbol}.tmp.$$.json_"
systemd-cat -t "`basename $0` $1" -p err <<< ${errMsg}
>&2 echo "${errMsg}"
exit 2
throw ${errMsg} err 2
else
quoteFileName=$(date "+%Y-%m-%d %H_%M_%S")_quote.${symbol}.json
#echo writing to file "${outDir}/${quoteFileName}"