   [creds table-name status & [{:keys [poll-ms timeout-ms timeout-val]
                                :or   {poll-ms 5000}}]]
   (assert (#{:creating :updating :deleting :active} (utils/un-enum status))
-          (throw (Exception. (str "Invalid table status: " status))))
+          (str "Invalid table status: " status))
   (let [polling-future
         (future
           (loop []

(defn query
  "Retries items from a table (indexed) with options:
    prim-key-conds - {<key-attr> [<comparison-operator> <values>] ...}.
    :last-prim-kvs - primary key-val from which to eval, useful for paging.
    :return        - e/o #{:all-attributes :all-projected-attributes :count
                           [<attr> ...]}.
    :index         - name of a secondary index to query.
    :order         - index scaning order e/o #{:asc :desc}.
    :limit         - max num >=1 of items to eval (≠ num of matching items).
    :consistent?   - use strongly (rather than eventually) consistent reads?

  comparison-operators e/o #{:eq :le :lt :ge :gt :begins-with :between}.

  For unindexed item retrievel see `scan`."
  [creds table prim-key-conds
   & [{:keys [last-prim-kvs return index order limit consistent? return-cc?]
       :or   {order :asc}}]]
  (as-map
   (.query (db-client creds)
     (doto-maybe (QueryRequest.) g
       :always (.setTableName        (name table))
       :always (.setKeyConditions    (query|scan-conditions prim-key-conds))
       :always (.setScanIndexForward (case order :asc true :desc false))
       last-prim-kvs   (.setExclusiveStartKey (clj-item->db-item g))
       limit           (.setLimit    (long g))
       index           (.setIndexName      g)
       consistent?     (.setConsistentRead g)
       (coll?* return) (.setAttributesToGet (mapv name return))
       return-cc? (.setReturnConsumedCapacity (utils/enum :total))
       (and return (not (coll?* return))) (.setSelect (utils/enum return))))))

(defn scan
  "Retrieves items from a table (unindexed) with options:
    :attr-conds     - {<attr> [<comparison-operator> <values>] ...}.
    :limit          - max num >=1 of items to eval (≠ num of matching items).
    :last-prim-kvs  - primary key-val from which to eval, useful for paging.
    :return         - e/o #{:all-attributes :all-projected-attributes :count
                            [<attr> ...]}.
    :total-segments - total number of parallel scan segments.
    :segment        - calling worker's segment number (>=0, <=total-segments).

  comparison-operators e/o #{:eq :le :lt :ge :gt :begins-with :between :ne
                             :not-null :null :contains :not-contains :in}.

(defn get-item
  "Retrieves an item from a table by its primary key with options:
    prim-kvs     - {<hash-key> <val>} or {<hash-key> <val> <range-key> <val>}.
    :attrs       - Attrs to return, [<attr> ...].
    :consistent? - Use strongly (rather than eventually) consistent reads?"
  [creds table prim-kvs & [{:keys [attrs consistent? return-cc?]}]]
  (as-map
   (.getItem (db-client creds)
