As suggested by @JDevlieghere, I have switched the callback that takes a string in the debug line error handling, with one that takes an Error. This allows using the same default function for both recoverable and unrecoverable errors. Further, to more clearly define which is which, I have renamed the two callbacks.
There are also some other minor tidy-ups/simplifications in relation to this change.