Fix 'er' vs 'err' typo and rename 'er'

The crucial element is a typographical error where `er` occurs instead of `err` on line 36.  This was difficult to detect because both `er` and `err` were valid variables in adjacent scopes.  The typo is a bug that must be fixed regardless of who patches it.  In this patch, I have also renamed `er` to `outError` to prevent further mistakes, which may not conform to project coding standards.