clegaspi / clegaspi/saml_reader

Consider restructuring how exceptions are thrown and caught

Open
#52 0 comments 0 reactions 0 assignees View on GitHub
code hygiene next up
Dominant language
Python
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Description

"Throw early, catch late"

Right now, the code base has a tendency to throw an exception, and then handle it in the calling function, even if that function may not be able to take action on it to "fix it". If it can't fix it, right now we have a lot of those functions throwing another exception with a similar message up to its calling function and so on until we can bubble that up to the CLI. We might as well let the CLI functions catch these errors and present the user with actionable information there.

It may be wise to create some more custom exception types if we're going to adopt this principle more strongly.

https://softwareengineering.stackexchange.com/questions/231057/exceptions-why-throw-early-why-catch-late

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.