Simplified err.go - same code existed in two different conditions.