docs: def get_exception_based_on_api_message(message, image_name=""):
      """Return the exception matching the given API error message."""
      msg_bigger_than_source = re.compile('Image was not scaled, is the requested width bigger than the source?')
      msg_does_not_exist = re.compile('The source file .* does not exist')
      msg_does_not_exist_bis = re.compile('<div class="error"><p>Value not found')
      if re.search(msg_bigger_than_source, message):
          msg = "File %s requested at a width bigger than source" % image_name
          return RequestedWidthBiggerThanSourceException(msg)
      elif re.search(msg_does_not_exist, message):
          msg = "File %s does not exist" % image_name
          return FileDoesNotExistException(msg)
      elif re.search(msg_does_not_exist_bis, message):
          msg = "File %s does not exist" % image_name
          return FileDoesNotExistException(msg)
      else:
          return DownloadException(message)