Replace sys.exit() in non-main functions by exceptions

Also move all exceptions into one module
2 jobs for exceptions in 18 minutes and 58 seconds (queued for 6 seconds)
latest
Status Job ID Name Coverage
  Test
passed #16908169
test

00:18:58

failed #16905275
test

00:14:24