from typing import Any
from typing import Tuple
import json


def json_encode(a: Any) -> Tuple[str, str]:
    """Returns a encoded into JSON and an error message, if any.
    """
    try:
        return (json.dumps(a), "")
    except Exception as ex:
        return ("", "Encode Error: %s" % ex)