simplify error handling API; use in passwd.html