def create_error_payload(exception, message, endpoint_id):
  """
  Creates an error payload to be send as a response in case of failure
  """

  print(f'{exception}: {message}')
  error_payload = {
    'status': 'MESSAGE_NOT_SENT',
    'endpointId': endpoint_id if endpoint_id else 'NO_ENDPOINT_ID',
    'message': f'{exception}: {message}'        
  }  
  return error_payload