Set error or window