Skip to content

Commit

Permalink
Build Error includes first line of backtrace
Browse files Browse the repository at this point in the history
[rails/web-console] is meant to display Ruby errors.

When presented with JS stack traces, or free text CLI error messages, it
confusingly displays a large (almost to the fold) white console box.

To make it more obvious what the client-side error was, we include the
first line of the backtrace in the `BuildError`'s message.

[rails/web-console]: https://github.com/rails/web-console
  • Loading branch information
seanpdoyle committed Nov 12, 2015
1 parent aaa3ac1 commit ddb11f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
master
------

* `BuildError#message` includes first line of backtrace. [#256]
* Exposes `build_timeout` configuration as `ENV["EMBER_BUILD_TIMEOUT"]`.
* Change default `build_timeout` to `15` seconds.
* Symlink `dist/` directly to Asset Pipeline [#250]
* Merge EmberCLI-generated `manifest.json` into Sprocket's [#250]
* `manifest.json`. Since we now defer to EmberCLI, we no longer need to
manually resolve asset URLs. [#250]

[#256]: https://github.com/thoughtbot/ember-cli-rails/pull/256
[#250]: https://github.com/thoughtbot/ember-cli-rails/pull/250

0.4.3
Expand Down
8 changes: 6 additions & 2 deletions lib/ember-cli/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ def build_error?
end

def raise_build_error!
error = BuildError.new("EmberCLI app #{name.inspect} has failed to build")
error.set_backtrace build_error_file_path.readlines
backtrace = build_error_file_path.readlines.reject(&:blank?)
message = "#{name.inspect} has failed to build: #{backtrace.first}"

error = BuildError.new(message)
error.set_backtrace(backtrace)

fail error
end

Expand Down

0 comments on commit ddb11f0

Please sign in to comment.