module Nginxtra::Error
Public Class Methods
print_error(thor, options)
click to toggle source
# File lib/nginxtra/error.rb, line 120 def print_error(thor, options) text = "" << thor.set_color(options[:header], :red, true) text << "\n\n" << thor.set_color(options[:message], :red, false) if options[:message] thor.print_wrapped text end
protect(thor) { || ... }
click to toggle source
# File lib/nginxtra/error.rb, line 126 def protect(thor) yield rescue Nginxtra::Error::Base => e e.output thor raise if thor.options["trace"] rescue print_error thor, header: "An unexpected error occurred!" raise if thor.options["trace"] end