@malcolmsparks btw, the new-classpath-resource needs this fix: https://github.com/juxt/yada/pull/209
@kardan What exactly do you want to accomplish?
@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.
We have solved that problem. I can tell you the details later today, but I’m busy right now.
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 🙂
Thanks for the message @borkdude
@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 yadaFurthermore, we have the classpath-resource as the last one in the bidi routes