Sha256: d2ccc274951e57ad6851021307d14e20f3b708d3bec6c83656e339b567f18f87

Contents?: true

Size: 974 Bytes

Versions: 1

Compression:

Stored size: 974 Bytes

Contents

require 'rubygems'
require File.join(File.dirname(__FILE__),'../','lib','exception.rb')

begin
  gem 'sinatra'
  require 'sinatra/base'
  require 'activesupport'
  require 'httparty'
rescue LoadError => e
  p <<DOC
-----------------------------------------------------------------------
LPM say:
The LPM server require sinatra and activesupport.
Please exec "gem install sinatra" or "gem install activesupport" first.
"gem install httparty" is needed as well
-----------------------------------------------------------------------
Ruby say:
#{e}
-----------------------------------------------------------------------
DOC
  exit(-1)
end

# include ActiveSupport::JSON
r = ':abc=>{girl},[hell0]:123:[abbbb],ele;'

begin
  # ActiveSupport::JSON.decode r
  raise RequestCodeError if r =~ /abc/
# rescue ActiveSupport::JSON::ParseError => e
#   p e
rescue RequestCodeError => e
  p e
  raise e,"from rescue RequestCodeError"
rescue Exception => e
  p r
ensure
  p 'silence.'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lpmp-1.0.0 test/exception.rb