Save errcode as well.