#🔒 Using try/exception on RPAs

6 messages · Page 1 of 1 (latest)

cerulean forum
#

Hi,

I’m working on a small RPA tool that submits information on a webpage. For this, I’ve created four main functions: login, get_info, submit, and save_submission (these are just example names). All these functions interact with a web API, database, or similar external resources.

I’m unsure where to place try/except blocks in my code. Specifically, I’m not sure if it’s necessary to include them in every function and in the main function, or if it’s better to limit them to only the smaller functions that interact with external resources.

Currently, the smaller functions (which are called by the four main functions) already have try/except blocks for handling external requests. Should I also wrap the main functions and the main script in try/except, or is this redundant?

I’d appreciate any advice on how to minimize and optimize the use of try/except in this scenario. Thanks in advance for your help! BocchiClueless

dawn nebulaBOT
#

@cerulean forum

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

queen ravine
#

all other exceptions should naturally bubble up and either be caught upstream or terminate the program

dawn nebulaBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.