cmawhorter / fancy

1 stars 2 forks source link

Config - Unmet mount option constraints lead to error #19

Open cmawhorter opened 8 years ago

cmawhorter commented 8 years ago

If a mount constraint is configured and not met, fancy serve will die with error Error: E.bubble callback called twice.

It should instead output a friendly message that some content does not match a configured constraint. (Ideally it'd include the exact config line).

Repro:

  1. Add to fancy.json
{
  "data": {
    "mount": {
      "blog": {
        "route": "^/blog/.*",
        "(author|title)": "^(.{10,}|.{0})$",
        "body": "!<a[^>]+?href=\"http:[^\"]+?\""
      }
    }
  }
}
  1. Create some new content with a matching resource
// ./content/data/blog/whatever.html
<meta key="route" value="/some-blog-post">
  1. In the content, don't include <meta key="author" value="something">
cmawhorter commented 8 years ago

The error being displayed is a bug but correct messages are output via logger but at the trace level. This log should probably be a warn so that it doesn't require verbose to see.