refactor: move error handling to catch block.

4 jobs for feat/#383-config-errors in 5 minutes and 44 seconds (queued for 1 second)