Replaced CUSTOM ERROR code with one defined in the constants.php file