atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

the API should not log exceptions and return "None".

Open jmatzdorff-cpi opened this issue 11 months ago • 8 comments

When searching for a page (using get_page_by_title) if the page does not exist, this currently gets executed:

except (IndexError, TypeError) as e:
     log.error("Can't find '%s' page on the %s!", title, self.url)
     log.debug(e)
     return None

(it also happens in update_page).

Please don't do this -- but rather return the exception back to the caller to handle what to do with the exception. The caller may want to handle it in some way and not have a ton of debug output printed out to the console or what not.

merely removing the try/except block would be much more useful.

jmatzdorff-cpi avatar Aug 21 '23 04:08 jmatzdorff-cpi