diff --git a/include/functions b/include/functions index f9e13c39..1f49fba0 100644 --- a/include/functions +++ b/include/functions @@ -533,13 +533,17 @@ # Name : DisplayError() # Description : Show error on screen # - # Input : $1 = text (string) + # Input : $1 = text (string), $2 = optional exit code (integer) # Returns : ################################################################################ DisplayError() { + EXITCODE="" + if [ $# -gt 1 ]; then EXITCODE=$2; fi + ${ECHOCMD} "" ${ECHOCMD} "${WARNING}Error${NORMAL}: ${BOLD}$1${NORMAL}" ${ECHOCMD} "" + if [ ! -z "${EXITCODE}" ]; then ExitCustom ${EXITCODE}; fi }