Cleanup - centralize the log handling
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user