basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

Give more helpful output during generate failure #102

Closed rzezeski closed 10 years ago

rzezeski commented 10 years ago

I am trying to make a stagedevrel on riak-pre9 and keep getting this error.

ERROR: generate failed while processing /root/yz-src-verify/riak_yz/rel: {'EXIT',
    {badarg,
        [{io_lib,format,
            ["Default: ~s",
              [{error,"could not convert off of type flag to a string"}]],
            [{file,"io_lib.erl"},{line,155}]},
        {cuttlefish_conf,generate_comments,1,
            [{file,"src/cuttlefish_conf.erl"},{line,125}]},
...

It is kind of helpful but gives me no idea which file/mapping generated it. This patch adds more info.

ERROR: generate failed while processing /root/yz-src-verify/riak_yz/rel: {{mapping,["dtrace"],
          "riak_core.dtrace_support",off,undefined,
          [flag],
          basic,
          ["DTrace support Do not enable 'dtrace' unless your Erlang/OTP",
          "runtime is compiled to support DTrace.  DTrace is available in",
          "R15B01 (supported by the Erlang/OTP official source package) and in",
          "R14B04 via a custom source repository & branch."],
          undefined,[],false,[]},
badarg,
[{io_lib,format,
          ["Default: ~s",
          [{error,"could not convert off of type flag to a string"}]],
          [{file,"io_lib.erl"},{line,155}]},
...
seancribbs commented 10 years ago

Also, updating cuttlefish will help, that was a bug we fixed late last week.

rzezeski commented 10 years ago

I think @jaredmorrow ran into it today? But this would help in future if stuff failed to generate. I had no idea where to look without it.

seancribbs commented 10 years ago

Ah, @joedevivo found the source of the problem, it was deeper than I thought. #103

seancribbs commented 10 years ago

I'd love to see a unit test for this.

seancribbs commented 10 years ago

Reopen if you feel strongly about this @rzezeski