Method: Sinatra::Reloader::BaseMethods#error

Defined in:
lib/sinatra/reloader.rb

#error(*codes, &block) ⇒ Object

Does everything Sinatra::Base#error does, but it also tells the Watcher::List for the Sinatra application to watch the defined error handler.



331
332
333
334
335
336
337
338
# File 'lib/sinatra/reloader.rb', line 331

def error(*codes, &block)
  path = caller_files[1] || File.expand_path($0)
  result = super
  codes.each do |c|
    watch_element(path, :error, code: c, handler: @errors[c])
  end
  result
end