code: def request(self, endpoint, method="GET", params=None):
      # Overriden to make something sensible out of a
      # request.RequestException rather than simply issuing a print(str(e))
      url = "%s/%s" % (self.api_url, endpoint)
  
      method = method.lower()
      params = params or {}
  
      func = getattr(self.client, method)
  
      request_args = {}
      if method == "get":
          request_args["params"] = params
      else:
          request_args["data"] = params
  
      # Added the try block
      try:
          response = func(url, **request_args)
      except requests.RequestException as e:
          return OandaRequestError().error_response
  
      content = response.content.decode("utf-8")
      content = json.loads(content)
  
      # error message
      if response.status_code >= 400:
          # changed from raise to return
          return oandapy.OandaError(content).error_response
  
      return content
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import collections
  from datetime import datetime, timedelta
  import time
  import json
  import threading
  import oandapy
  import requests
  import backtrader
  from backtrader.metabase import MetaParams
  from backtrader.utils.py3 import queue, with_metaclass
  from backtrader.utils import AutoDict
label_desc: Use image node_id 1 for calling the API obj's underlying member method code with example usage: obj.request(endpoint, method, params) and returns: content, oandapy, OandaRequestError