corrected error code setting in ErrorHandlers