PGScatalog / pgscatalog_utils

(superseded by pygscatalog) Utilities for working with PGS Catalog API and scoring files
Apache License 2.0
4 stars 3 forks source link

Add custom exceptions #73

Closed nebfield closed 8 months ago

nebfield commented 8 months ago

This module defines a custom PGS exception hierarchy. There's a lot of exceptions for specific failure states, which can be a bad approach and too complex. However, we did this anyway for a few reasons:

  1. There's only a few types of common errors (around a dozen, with 3-4 very common)
  2. Want to exit the program with custom exit codes to simplify communicating program state with external processes (e.g. PGS Catalog Calculator) without doing complicated things like logging to an external location
  3. This approach should make maintaining exit codes simple

So the plan is to override sys.excepthook, intercept errors defined here, and map them to custom exit codes defined below