<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def verify_ed25519_signature(public_key, contents, signature, message):
 """Verify that ``signature`` comes from ``public_key`` and ``contents``. Args: public_key (Ed25519PublicKey):
 the key to verify the signature contents (bytes):
 the contents that was signed signature (bytes):
 the signature to verify message (str):
 the error message to raise. Raises: ScriptWorkerEd25519Error: on failure """

    try:
        public_key.verify(signature, contents)
    except InvalidSignature as exc:
        raise ScriptWorkerEd25519Error(message % {'exc': str(exc)})