diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl/app.rb | 2 | ||||
| -rw-r--r-- | lib/hcl/net.rb | 6 | 
2 files changed, 6 insertions, 2 deletions
| diff --git a/lib/hcl/app.rb b/lib/hcl/app.rb index 0cda7b4..14f626d 100644 --- a/lib/hcl/app.rb +++ b/lib/hcl/app.rb @@ -66,7 +66,7 @@ module HCl        rescue RuntimeError => e          $stderr.puts "Error: #{e}"          exit 1 -      rescue SocketError => e +      rescue Faraday::Error => e          $stderr.puts "Connection failed. (#{e.message})"          exit 1        rescue HarvestMiddleware::ThrottleFailure => e diff --git a/lib/hcl/net.rb b/lib/hcl/net.rb index 730e5b4..ac794d6 100644 --- a/lib/hcl/net.rb +++ b/lib/hcl/net.rb @@ -19,7 +19,11 @@ module HCl          "https://#{subdomain}.harvestapp.com"        ) do |f|          f.use :harvest, login, password -        f.adapter Faraday.default_adapter +        if opts['test_adapter'] +          f.adapter :test, opts['test_adapter'] +        else +          f.adapter Faraday.default_adapter +        end        end      end | 
