Use \errmessage rather than \PackageError because not all TeX variants provide the latter.