Skip to content

Add more descriptive error message for "template not found" error case #4

@jsyrjala

Description

@jsyrjala

If I attempt to refer to a template that doesn't exist, like this

(defn send-email [name email]
  (deliver-email {:from "myaddress@example.com", :to [email] :subject "my-subject"}
                 "templates/email/not-found.moustache" 
                 {:name name :email email}))

I get following rather cryptic exception:

IllegalArgumentException No implementation of method: :make-reader of protocol: 
#'clojure.java.io/IOFactory found for class: nil  clojure.core/-cache-protocol-fn (core_deftype.clj:541)

Something like this would be better:
IllegalArgumentException Template 'templates/email/not-found.moustache' was not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions