Unified error analysis for Newton-type methods