macchiato-framework / macchiato-core

Ring style HTTP server abstraction for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

https server starts with non existing key and certificate files without any hint that something went wrong

nenadalm opened this issue · comments

Here is place that reads files:

(let [pk (fs/slurp private-key)

but in case of non existent files, it just proceeds silently (https://github.com/macchiato-framework/macchiato-fs/blob/1561f573de04d373aa3ae8b233b25f5f4abc1052/src/macchiato/fs.cljs#L27)

I noticed this on ci, where I've got message that server started, but curl wouldn't return status 200 when checking if started.

Maybe slurp in macchiato-fs should return exception as it does in Clojure? Or macchiato-core should check if files exists?

Yeah, I think slurp throwing an exception would be the way to go. I'll try take a look soonish, but if you'd be up for doing a PR I can do a new release with it as well.