Liking cljdoc? Tell your friends :D

cider.nrepl.middleware.stacktrace

Cause and stacktrace analysis for exceptions

Cause and stacktrace analysis for exceptions
raw docstring

analyze-causeclj

(analyze-cause e print-fn)

Return a map describing the exception cause. If ex-data exists, a :data key is appended.

Return a map describing the exception cause. If `ex-data` exists, a `:data`
key is appended.
sourceraw docstring

analyze-causesclj

(analyze-causes e print-fn)

Return the cause chain beginning with the thrown exception, with stack frames for each. For ex-info exceptions response contains :data slot with pretty printed data. For clojure.spec asserts, :spec slot contains a map of pretty printed components describing spec failures.

Return the cause chain beginning with the thrown exception, with stack frames
for each. For `ex-info` exceptions response contains :data slot with pretty
printed data. For clojure.spec asserts, :spec slot contains a map of pretty
printed components describing spec failures.
sourceraw docstring

analyze-fileclj

(analyze-file {:keys [file] :as frame})

Associate the file type (extension) of the source file to the frame map, and add it as a flag. If the name is NO_SOURCE_FILE, type clj is assumed.

Associate the file type (extension) of the source file to the frame map, and
add it as a flag. If the name is `NO_SOURCE_FILE`, type `clj` is assumed.
sourceraw docstring

analyze-fnclj

(analyze-fn {:keys [type class method] :as frame})

Add namespace, fn, and var to the frame map when the source is a Clojure function.

Add namespace, fn, and var to the frame map when the source is a Clojure
function.
sourceraw docstring

analyze-frameclj

(analyze-frame namespaces frame)

Return the stacktrace as a sequence of maps, each describing a stack frame.

Return the stacktrace as a sequence of maps, each describing a stack frame.
sourceraw docstring

analyze-stacktraceclj

(analyze-stacktrace e)

Return the stacktrace as a sequence of maps, each describing a stack frame.

Return the stacktrace as a sequence of maps, each describing a stack frame.
sourceraw docstring

directory-namespacesclj

(directory-namespaces)

Looks for all namespaces inside of directories on the class path, ignoring jars.

It's a defn because this set is always subject to change.

NOTE: depending on the use case, you might want to filter out namespaces such as user which while belong to the project, don't share a common naming scheme with the other namespaces.

Looks for all namespaces inside of directories on the class
path, ignoring jars.

It's a defn because this set is always subject to change.

NOTE: depending on the use case, you might want to filter out
namespaces such as `user` which while belong to the project,
don't share a common naming scheme with the other namespaces.
sourceraw docstring

extract-locationclj

(extract-location {:keys [class message location] :as cause})

If the cause is a compiler exception, extract the useful location information from its message or from :location if provided. Include relative path for simpler reporting.

If the cause is a compiler exception, extract the useful location information
from its message or from `:location` if provided.
Include relative path for simpler reporting.
sourceraw docstring

filtered-ex-dataclj

(filtered-ex-data e)

Same as ex-data, but filters out entries whose keys are blacklisted (generally for containing data not intended for reading by a human).

Same as `ex-data`, but filters out entries whose keys are
blacklisted (generally for containing data not intended for reading by a
human).
sourceraw docstring

flag-duplicatesclj

(flag-duplicates frames)

Where a parent and child frame represent substantially the same source location, flag the parent as a duplicate.

Where a parent and child frame represent substantially the same source
location, flag the parent as a duplicate.
sourceraw docstring

flag-frameclj

(flag-frame frame flag)

Update frame's flags vector to include the new flag.

Update frame's flags vector to include the new flag.
sourceraw docstring

flag-projectclj

(flag-project namespaces {:keys [ns] :as frame})

Flag the frame if it is from the users project. From a users project means that the namespace is one we have identified or it begins with the identified common prefix.

Flag the frame if it is from the users project. From a users
project means that the namespace is one we have identified or it
begins with the identified common prefix.
sourceraw docstring

flag-replclj

(flag-repl {:keys [file] :as frame})

Flag the frame if its source is a REPL eval.

Flag the frame if its source is a REPL eval.
sourceraw docstring

flag-toolingclj

(flag-tooling frames)

Walk the call stack from top to bottom, flagging frames below the first call to clojure.lang.Compiler or nrepl.* as :tooling to distinguish compilation and nREPL middleware frames from user code.

Walk the call stack from top to bottom, flagging frames below the first call
to `clojure.lang.Compiler` or `nrepl.*` as `:tooling` to
distinguish compilation and nREPL middleware frames from user code.
sourceraw docstring

handle-stacktraceclj

(handle-stacktrace _
                   {:keys [session transport :nrepl.middleware.print/print-fn]
                    :as msg})
source

ns-common-prefixclj

In order to match more namespaces, we look for a common namespace prefix across the ones we have identified.

In order to match more namespaces, we look for a common namespace
prefix across the ones we have identified.
sourceraw docstring

ns-common-prefix*clj

(ns-common-prefix* namespaces)
source

prepare-spec-dataclj

(prepare-spec-data ed pprint-str)

Prepare spec problems for display in user stacktraces. Take in a map ed as returned by clojure.spec/explain-data and return a map of pretty printed problems. The content of the returned map is modeled after clojure.spec/explain-printer.

Prepare spec problems for display in user stacktraces.
Take in a map `ed` as returned by `clojure.spec/explain-data` and return a map
of pretty printed problems. The content of the returned map is modeled after
`clojure.spec/explain-printer`.
sourceraw docstring

relative-pathclj

(relative-path path)

If the path is under the project root, return the relative path; otherwise return the original path.

If the path is under the project root, return the relative path; otherwise
return the original path.
sourceraw docstring

spec-abbrevclj

source

stack-frameclj

(stack-frame frame)

Return a map describing the stack frame.

Return a map describing the stack frame.
sourceraw docstring

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

× close