and this will throw an error if `caDir` is `undefined`, `null` or does not exist. please add in a `try-catch` and `log.error` in that case