mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move error message output to another method
This commit is contained in:
parent
38ec35dd29
commit
9527427b45
1 changed files with 9 additions and 4 deletions
|
@ -83,10 +83,15 @@ module Spectator
|
||||||
# But if an exception occurs outside an example,
|
# But if an exception occurs outside an example,
|
||||||
# it's likely the fault of the test framework (Spectator).
|
# it's likely the fault of the test framework (Spectator).
|
||||||
# So we display a helpful error that could be reported and return non-zero.
|
# So we display a helpful error that could be reported and return non-zero.
|
||||||
puts
|
display_error(ex)
|
||||||
puts "Encountered an unexpected error in framework"
|
|
||||||
puts ex.message
|
|
||||||
puts ex.backtrace.join("\n")
|
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Displays an error message.
|
||||||
|
private def self.display_error(error)
|
||||||
|
puts
|
||||||
|
puts "Encountered an unexpected error in framework"
|
||||||
|
puts error.message
|
||||||
|
puts error.backtrace.join("\n")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue