Raise exception when not using correct boolean operators