Liking cljdoc? Tell your friends :D

adl-support.core

Application Description Language support - utility functions likely to be useful in user-written code.

Application Description Language support - utility functions likely
to be useful in user-written code.

*warn*

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.
sourceraw docstring

compose-exception-reasonmacro

(compose-exception-reason exception)
(compose-exception-reason exception intro)

Compose and return a sensible reason message for this exception.

Compose and return a sensible reason message for this `exception`.
sourceraw docstring

compose-reason-and-logmacro

(compose-reason-and-log exception)
(compose-reason-and-log exception intro)

Compose a reason message for this exception, log it (with its stacktrace), and return the reason message.

Compose a reason message for this `exception`, log it (with its
stacktrace), and return the reason message.
sourceraw docstring

do-or-log-and-return-reasonmacro

(do-or-log-and-return-reason form)

Clojure stacktraces are unreadable. We have to do better; evaluate this form in a try-catch block; return a map. If the evaluation succeeds, the map will have a key :result whose value is the result; otherwise it will have a key :error which will be bound to the most sensible error message we can construct. Additionally, log the exception

Clojure stacktraces are unreadable. We have to do better; evaluate
this `form` in a try-catch block; return a map. If the evaluation
succeeds, the map will have a key `:result` whose value is the result;
otherwise it will have a key `:error` which will be bound to the most
sensible error message we can construct. Additionally, log the exception
sourceraw docstring

do-or-log-errormacro

(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.
sourceraw docstring

do-or-return-reasonmacro

(do-or-return-reason form)
(do-or-return-reason form intro)

Clojure stacktraces are unreadable. We have to do better; evaluate this form in a try-catch block; return a map. If the evaluation succeeds, the map will have a key :result whose value is the result; otherwise it will have a key :error which will be bound to the most sensible error message we can construct.

Clojure stacktraces are unreadable. We have to do better; evaluate
this `form` in a try-catch block; return a map. If the evaluation
succeeds, the map will have a key `:result` whose value is the result;
otherwise it will have a key `:error` which will be bound to the most
sensible error message we can construct.
sourceraw docstring

do-or-warnmacro

(do-or-warn form)
(do-or-warn form intro)

Evaluate this form; if any exception is thrown, show it to the user via the *warn* mechanism.

Evaluate this `form`; if any exception is thrown, show it to the user
via the `*warn*` mechanism.
sourceraw docstring

do-or-warn-and-logmacro

(do-or-warn-and-log form)
(do-or-warn-and-log form intro)

Evaluate this form; if any exception is thrown, log the reason and show it to the user via the *warn* mechanism.

Evaluate this `form`; if any exception is thrown, log the reason and
show it to the user via the `*warn*` mechanism.
sourceraw docstring

massage-params

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.
sourceraw docstring

massage-value

(massage-value k m)

Return a map with one key, this k as a keyword, whose value is the binding of k in map m, as read by read.

Return a map with one key, this `k` as a keyword, whose value is the binding of
`k` in map `m`, as read by read.
sourceraw docstring

raw-massage-params

(raw-massage-params request)
(raw-massage-params request entity)

Sending empty strings, or numbers as strings, to the database often isn't helpful. Massage these params and form-params to eliminate these problems. Date and time fields also need massaging.

Sending empty strings, or numbers as strings, to the database often isn't
helpful. Massage these `params` and `form-params` to eliminate these problems.
Date and time fields also need massaging.
sourceraw docstring

raw-resolve-template

(raw-resolve-template n)
source

resolve-template

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close