yada

borkdude 2017-12-02T13:05:28.000076Z

@malcolmsparks btw, the new-classpath-resource needs this fix: https://github.com/juxt/yada/pull/209

1👍
borkdude 2017-12-02T13:06:20.000018Z

@kardan What exactly do you want to accomplish?

kardan 2017-12-02T13:21:50.000013Z

@borkdude essentially I tried to have a route structure [… [“assets/” class-path-hander] [true not-found-handler]]. A request with /no-match-url would end up in “my” not-found-handler. But a request to /assets/no-match-url would end up in Yada’s build in 404 page.

borkdude 2017-12-02T13:23:00.000046Z

We have solved that problem. I can tell you the details later today, but I’m busy right now.

kardan 2017-12-02T13:24:26.000002Z

No worries. I’m also busy, so no stress. I was thinking that he new-classpath-resource should return nil and not always a resource. But have not have time to investigate. So look forward to the fix 🙂

kardan 2017-12-02T13:24:44.000082Z

Thanks for the message @borkdude

borkdude 2017-12-02T14:47:02.000054Z

@kardan I looked into it, and we did it like this:

(defmethod render-error "text/html"
    [status ^Throwable error representation {:keys [id options] :as m}]
    (parser/render-file
     "error.html"
     {:status status
      :message (format "%d: %s" status (body/get-error-message status))
      :description (body/get-error-description status)
      :exception (when dev-env?
                   (let [baos (java.io.ByteArrayOutputStream.)
                         pw (java.io.PrintWriter.
                             (java.io.OutputStreamWriter. baos))]
                     (.printStackTrace error pw)
                     (.flush pw)
                     (String. (.toByteArray baos))))}))
so overriding some behavior of yada

borkdude 2017-12-02T14:47:59.000043Z

Furthermore, we have the classpath-resource as the last one in the bidi routes