I find it inconsistent that you instantiate an empty error handler in the constructor, while you nil-check the `headerGenerator` only when it's about to be called. I think it would be more straightforward to instantiate an empty header generator in the constructor as well. Looking at this function (in lieu of documentation) I feel I can pass `nil` for the `errHandler` but I must give a valid `headerGenerator`.