Exceptions, Logging, Debugging

This course introduces one of the many aspects of writing good code – i.e., code that can be read, maintained and redeployed by others in your team. A principled approach to discovering and handling runtime errors is key to getting rid of preventable problems that can threaten your application’s stability and security.

Suitability

Tech Analysts, S&T Analysts (optionally)

Learning Outcomes

By the end of this course, participants should be able to:
• Enumerate and deploy the native Exceptions within Python
• Write simple code which try/catch/raises them
• Evaluate where is the best place in code to implement them
• Create custom Exception classes.
• Use the most common features of standard Python logging and debugging packages.

Course Content

• Orientation: Errors or Exceptions?
• Common types of exceptions
o Value Error
o Name Error
o DividebyZeroError.
• Exception syntax (try, catch, raise, finally).
• User-defined exceptions with automated clean-up/roll-back functionality.
• Workshop 1: implement a simple user form and catch all possible exceptions resulting from improper user input.
• Debugging with pdb.
• Logging with logging, including writing handlers for multiple logs.
• Workshop 2: implement logging on the example in Workshop 1, with three separate logs,
o one to log access to the form,
o one to log user-generated errors,
o and a third to log system errors (e.g. application force stop/downtime)

100%

of our clients would recommend Alpha to a colleague or peer

90%

of a cohort was promoted within 2 years after participating in an Alpha course.

96%

of participants felt more confident in their role, following an Alpha commercial leadership course.

Why study with Alpha?

Innovation and creativity born from experience

We are thought leaders in instructional and learning journey design and holistic solution architects. We have extensive finance and investments experience combined with skills application to deliver performance improving results. We develop immersive learning environments that maximize time to productivity, support talent retention and added value to improving quality of hires.

Knowledge Exchange Evangelists

We are focused on mining the embedded organisational intellectual capital for the benefit of the next generation. We create and curate best in class practice gathered from our experience with the leading financial institutions. We design our programmes with the end in mind – what results are you trying to achieve with this intervention? What metrics will we set ourselves to achieve that?

Generation Proof

Quality and innovation, using current market and industry best practices, have made us a trusted partner in delivering dynamic and motivating training for the financial and capital markets. Our programmes are generation proof and responsive to evolving learner needs and styles. Our solutions use a multi-stakeholder engagement strategy that expands beyond relationships between the learner and learning provider. We create connections with managers, peers and the wider business to drive impactful return on investment..

Enquire now

"*" indicates required fields

This form collects your contact information so that we can correspond with you.
Check out our privacy policy for more information about how we protect and manage your data.
This field is for validation purposes and should be left unchanged.
The team are so friendly and pleasant to work with, everyone is very professional and keen to help us. Building a relationship over the past couple of years helps us to feel like the Alpha team are even more able to understand our needs and provide more proactive solutions.
Find out more about our in-house training courses