   string describing the error."
   [status-fn :- StatusFn
    level :- ServiceStatusDetailLevel
-   timeout :- schema/Int]
+   timeout :- WholeSeconds]
    (let [unknown-response (fn [status] {:state :unknown
                                         :status status})
          timeout-response (unknown-response (format "Status check timed out after %s seconds" timeout))]


(schema/defn ^:always-validate guarded-status-fn-call :- StatusCallbackResponse
  "Given a status check function, a status detail level, and a timeout in
  seconds, this function calls the status function and handles three types of
  errors:

  * Status check timed out
  * Status check threw an Exception

    (validation-error-explain schema-failure)
    schema-failure))

(schema/defn check-timeout :- WholeSeconds
  "Given a status level keyword, returns an integral number of seconds to use as
  a timeout when calling a status function."
  [level :- ServiceStatusDetailLevel]
  (case level
    :critical 5
