Throwing builder exception on invalid mode.