Skip to content

Commit

Permalink
Generalize error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo committed Apr 20, 2017
1 parent c34ca1d commit 5bf1d8c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/compatible_date.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ date_today () {

local exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${0##*/}:date_today failed to produce date string" >&2
echo "ERROR: ${0##*/}:$FUNCNAME failed to produce date string" >&2
return $exit_status
fi

Expand All @@ -53,7 +53,7 @@ dateTime_now_locale () {

local exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${0##*/}:dateTime_now_locale failed to produce date string" >&2
echo "ERROR: ${0##*/}:$FUNCNAME failed to produce date string" >&2
return $exit_status
fi

Expand All @@ -69,7 +69,7 @@ dateTime_now_canonical () {

local exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${0##*/}:dateTime_now_canonical failed to produce date string" >&2
echo "ERROR: ${0##*/}:$FUNCNAME failed to produce date string" >&2
return $exit_status
fi

Expand All @@ -87,7 +87,7 @@ dateTime_max32_canonical () {
dateTime_openssl2canonical () {
local in_date="$1"
if [ -z "${in_date}" ] ; then
echo "ERROR: ${0##*/}:dateTime_openssl2canonical requires command-line arg" >&2
echo "ERROR: ${0##*/}:$FUNCNAME requires command-line arg" >&2
return 1
fi

Expand All @@ -104,7 +104,7 @@ dateTime_openssl2canonical () {

local exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${0##*/}:dateTime_openssl2canonical failed to convert date string ${in_date}" >&2
echo "ERROR: ${0##*/}:$FUNCNAME failed to convert date string ${in_date}" >&2
return $exit_status
fi

Expand All @@ -116,7 +116,7 @@ dateTime_openssl2canonical () {
dateTime_apache2canonical () {
local in_date="$1"
if [ -z "${in_date}" ] ; then
echo "ERROR: ${0##*/}:dateTime_openssl2canonical requires command-line arg" >&2
echo "ERROR: ${0##*/}:$FUNCNAME requires command-line arg" >&2
return 1
fi

Expand All @@ -133,7 +133,7 @@ dateTime_apache2canonical () {

local exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${0##*/}:dateTime_openssl2canonical failed to convert date string ${in_date}" >&2
echo "ERROR: ${0##*/}:$FUNCNAME failed to convert date string ${in_date}" >&2
return $exit_status
fi

Expand All @@ -145,7 +145,7 @@ dateTime_apache2canonical () {
dateTime_canonical2secs () {
local in_date="$1"
if [ -z "${in_date}" ] ; then
echo "ERROR: ${0##*/}:dateTime_canonical2secs requires command-line arg" >&2
echo "ERROR: ${0##*/}:$FUNCNAME requires command-line arg" >&2
return 1
fi

Expand All @@ -165,7 +165,7 @@ dateTime_canonical2secs () {

local exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${0##*/}:dateTime_canonical2secs failed to convert date string ${in_date}" >&2
echo "ERROR: ${0##*/}:$FUNCNAME failed to convert date string ${in_date}" >&2
return $exit_status
fi

Expand All @@ -177,7 +177,7 @@ dateTime_canonical2secs () {
dateTime_secs2canonical () {
local in_secs="$1"
if [ -z "${in_secs}" ] ; then
echo "ERROR: ${0##*/}:dateTime_secs2canonical requires command-line arg" >&2
echo "ERROR: ${0##*/}:$FUNCNAME requires command-line arg" >&2
return 1
fi

Expand All @@ -193,7 +193,7 @@ dateTime_secs2canonical () {

local exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${0##*/}:dateTime_secs2canonical failed to convert seconds ${in_secs}" >&2
echo "ERROR: ${0##*/}:$FUNCNAME failed to convert seconds ${in_secs}" >&2
return $exit_status
fi

Expand Down

0 comments on commit 5bf1d8c

Please sign in to comment.