code: def check_error(result):
      
      return (result.value != ReturnCode.SUCCESSFUL) and (result.value < ReturnCode.WARNING)
docs: Checks if any function returns an error from USB-CAN-library.
  
      :param ReturnCode result: Error code of the function.
      :return: True if a function returned error, otherwise False.
      :rtype: bool