The idea here is to have a function with which to show warnings to the user, which can be dynamically bound. Any binding should be a function of one argument, which it should print, log, or otherwise display.
The idea here is to have a function with which to show warnings to the user, which can be dynamically bound. Any binding should be a function of one argument, which it should print, log, or otherwise display.
(do-or-log-error form
&
{:keys [message error-return]
:or {message (clojure.core/seq
(clojure.core/concat
(clojure.core/list (quote clojure.core/str))
(clojure.core/list "A failure occurred in ")
(clojure.core/list (list (quote quote)
form))))}})
Evaluate the supplied form
in a try/catch block. If the
keyword param :message
is supplied, the value will be used
as the log message; if the keyword param :error-return
is
supplied, the value will be returned if an exception is caught.
Evaluate the supplied `form` in a try/catch block. If the keyword param `:message` is supplied, the value will be used as the log message; if the keyword param `:error-return` is supplied, the value will be returned if an exception is caught.
(massage-params params form-params key-fields)
Sending empty strings, or numbers as strings, to the database often isn't
helpful. Massage these params
and form-params
to eliminate these problems.
We must take key field values out of just params, but we should take all other
values out of form-params - because we need the key to load the form in
the first place, but just accepting values of other params would allow spoofing.
Sending empty strings, or numbers as strings, to the database often isn't helpful. Massage these `params` and `form-params` to eliminate these problems. We must take key field values out of just params, but we should take all other values out of form-params - because we need the key to load the form in the first place, but just accepting values of other params would allow spoofing.
(query-string-to-map query-string)
A query-string
- the query-part of a URL - comprises generally
<name>=<value>&<name>=<value>...
; reduce such a string to a map.
If query-string
is nil or empty return an empty map.
A `query-string` - the query-part of a URL - comprises generally `<name>=<value>&<name>=<value>...`; reduce such a string to a map. If `query-string` is nil or empty return an empty map.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close