def build_file_share_error_response(asset_id: str, error_msg: str=''):
    """
    Builds a proper error response to the jquery-file-share browser client

    {"files": [
      {
        "asset_id": "5f66e619-ab8d-4491-8b49-740476e6b08c",
        "error": "Key server error"
      },
      {
        "asset_id": "22727033-67ee-4b5a-8095-4a565b3ebfd9",
        "error": "Bad Request"
      }
    ]}

    :param error_msg:
    :param asset_id: Asset uuid of the file to be shared
    :return: A properly formatted response
    """
    response = dict()
    response['files'] = list()
    file_dict = dict()
    file_dict['asset_id'] = asset_id
    file_dict['error'] = error_msg
    response['files'].append(file_dict)
    return response
