Module: Sinatra::Errors

Defined in:
lib/extensions/errors.rb

Instance Method Summary collapse

Instance Method Details

#errorsObject



15
16
17
# File 'lib/extensions/errors.rb', line 15

def errors
  @errors
end

#setup_errorsObject



3
4
5
# File 'lib/extensions/errors.rb', line 3

def setup_errors
  @errors = []
end

#try(&block) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/extensions/errors.rb', line 7

def try(&block)
  begin
    yield
  rescue Exception => e
    @errors << e.message
  end
end