def create_error_response(code, jrpc_id, msg):
    """
    Creates JSON RPC error response.

    Parameters :
        code: Error code
        jrpc_id: JSON RPC id
        msg: Error message
    Returns :
        JSON RPC error response as JSON object.
    """
    error_response = {}
    error_response["jsonrpc"] = "2.0"
    error_response["id"] = jrpc_id
    error_response["error"] = {}
    error_response["error"]["code"] = code
    error_response["error"]["message"] = msg
    return error_response