better error messaging when registration or sign in fails