 ; implied. See the License for the specific language governing permissions
 ; and limitations under the License.
 
-(ns #^{:doc "Exception reporting"}
+(ns #^{:doc "Exception reporting view and pipeline"}
   cascade.exception
   (:import (java.lang Throwable StackTraceElement))
-  (:require
+  (:require  	
   	(clojure.contrib (str-utils2 :as s2)))
   (:use 
+  	(clojure stacktrace)
   	cascade 
   	(cascade.internal utils)
   	(cascade config logging pipeline renderer)))

  })  
  
(defn transform-stack-trace
  "Transforms a primitive array of StackTraceElements into individual maps; each with two keys:
  :frame is a string representing the method name and location,
  :class is a string (may be nil) used when rendering the frame (values to be defined)."
  [elements]
  ;; Currently very simple, but will expand in the future, when we convert Java stack frames
  ;; for Clojure code into clojure names, and use the CSS class to hide uninteresting
  ;; stack frames, and highlight application stack frames.
  (loop [seen-filter false
  			 queue (map transform-stack-frame (seq elements))
  			 result []]


(defn include-js-library
  [env path]
  (template
  	; Force open/close tags for stupid browser compatibility       
  	:script { :type "text/javascript" :src (classpath-asset-path env path) } [ linebreak ]))

(defview exception-report
