why don't you do `err = safeError(err)` ? it looks weird to call this twice each time...
but this is not a blocker, I'll r+ the patch