Typo fix on exception

Changing `throw err` to `throw error` based on passed in parameter name.