function exitFatalError($orderIdentif, $logText) { store_log($orderIdentif, $logText); //prepare image with error description header("Content-type: " . image_type_to_mime_type(IMAGETYPE_GIF)); $arrErrDesc = getErrorDescription($logText); $strErrDescs = array("Label could not be received.", "", $arrErrDesc["errAction"], $arrErrDesc["errDesc1"], $arrErrDesc["errYEnt"], $arrErrDesc["errDesc2"]); $im = imagecreate(672, 392); $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 128, 0, 0); for ($ii = 50, $iw = 0; $ii < 672 && $iw < count($strErrDescs); $ii += 19, $iw++) { $strs = split("\n", wordwrap($strErrDescs[$iw], 70, "\n")); for ($jw = 0; $ii < 672 && $jw < count($strs); $ii += 16, $jw++) { imagestring($im, 5, 20, $ii, $strs[$jw], $text_color); } } imagegif($im); imagedestroy($im); exit; }
/** * raises the error and prints it pretty */ function raiseError($error, $query, $file, $line_number) { throw new Exception(getErrorDescription($error, $query, $file, $line_number)); }