Display first line only after "Error:"

This commit is contained in:
Michael Miller 2020-08-16 10:00:04 -06:00
parent ca03e75b99
commit 53c9dd0445
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD

View file

@ -77,7 +77,8 @@ module Spectator::Formatting
# Produces the stack trace for an errored result. # Produces the stack trace for an errored result.
private def error_stacktrace(indent) private def error_stacktrace(indent)
error = @result.error error = @result.error
indent.line(Color.error(LabeledText.new("Error", error))) first_line = error.message.try(&.lines).try(&.first)
indent.line(Color.error(LabeledText.new("Error", first_line)))
indent.line indent.line
indent.increase do indent.increase do
loop do loop do