MovableInkAWS 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee1a2c8481d6a86018db27fd2b80bd5860893c8a615640c5f49b82ae73aee4b2
4
- data.tar.gz: 87cabc275736604f8157a9794611c28603858f233619edf90325440cbc03bbc8
3
+ metadata.gz: 32cc5f4b290b7afc559ccc8c34f3abf54c5c2216aaca0b2d4d5f1d066dddee48
4
+ data.tar.gz: b14670bd7662e6e013c3889af9cf2da3ff4e64ebb01470f9a1d022aced3e3396
5
5
  SHA512:
6
- metadata.gz: 0ed46b18675f3443e3c16c8fec22b2a0a9ddb3847f9dc2c4b1898b703daa39bf31f5494207ff5039ed797170e1cb20c32999ff8a2005d3060637b9cd3f1d47c7
7
- data.tar.gz: 5300b9afe47940466a709feed4d4fa30cd33fd55a63fa3cadf38a628cbb147a92d6d85ceffbc873be09ded9f1fdf902af5996e5764c22f4303c77bdbb0da552e
6
+ metadata.gz: 3292926afdd6716234a244c4b3a8e1fb99ddbf2b421383bee0a28ef54244587f8b919717e1b2fb8f23858e0f91970f5583b9f7faa6e680b323610a75c57b1b49
7
+ data.tar.gz: 85f0a66e12260cb970dc80902979188926e123d803ec1267c816ac543d7e951b6209a3fcca179ff4d4aed651c48fca9d5f2f8e704346b9ba3728fe755327698d
data/Gemfile.lock CHANGED
@@ -1,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- MovableInkAWS (0.1.8)
4
+ MovableInkAWS (0.1.10)
5
5
  aws-sdk (~> 2.11, >= 2.11.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- aws-sdk (2.11.21)
11
- aws-sdk-resources (= 2.11.21)
12
- aws-sdk-core (2.11.21)
10
+ aws-sdk (2.11.88)
11
+ aws-sdk-resources (= 2.11.88)
12
+ aws-sdk-core (2.11.88)
13
13
  aws-sigv4 (~> 1.0)
14
14
  jmespath (~> 1.0)
15
- aws-sdk-resources (2.11.21)
16
- aws-sdk-core (= 2.11.21)
17
- aws-sigv4 (1.0.2)
15
+ aws-sdk-resources (2.11.88)
16
+ aws-sdk-core (= 2.11.88)
17
+ aws-sigv4 (1.0.3)
18
18
  diff-lcs (1.3)
19
- jmespath (1.3.1)
19
+ jmespath (1.4.0)
20
20
  rspec (3.6.0)
21
21
  rspec-core (~> 3.6.0)
22
22
  rspec-expectations (~> 3.6.0)
@@ -39,4 +39,4 @@ DEPENDENCIES
39
39
  rspec (~> 3.6)
40
40
 
41
41
  BUNDLED WITH
42
- 1.16.1
42
+ 1.16.2
@@ -1,6 +1,7 @@
1
1
  module MovableInk
2
2
  class AWS
3
3
  module Errors
4
+ class ServiceError < StandardError; end
4
5
  class FailedWithBackoff < StandardError; end
5
6
  class EC2Required < StandardError; end
6
7
  class NoEnvironmentTagError < StandardError; end
@@ -43,7 +43,7 @@ module MovableInk
43
43
  Aws::AutoScaling::Errors::ThrottledException,
44
44
  Aws::S3::Errors::SlowDown,
45
45
  Aws::Route53::Errors::ThrottlingException,
46
- Aws::Route53::Errors::ServiceError,
46
+ Aws::Route53::Errors::PriorRequestNotComplete,
47
47
  Aws::SSM::Errors::TooManyUpdates,
48
48
  Aws::Athena::Errors::ThrottlingException,
49
49
  MovableInk::AWS::Errors::NoEnvironmentTagError
@@ -53,6 +53,12 @@ module MovableInk
53
53
  else
54
54
  notify_and_sleep(sleep_time, $!.class)
55
55
  end
56
+ rescue Aws::Errors::ServiceError => e
57
+ message = "#{e.class}: #{e.message}\nFrom `#{e.backtrace.last.gsub("`","'")}`"
58
+ notify_slack(subject: 'Unhandled AWS API Error',
59
+ message: message)
60
+ puts message
61
+ raise MovableInk::AWS::Errors::ServiceError
56
62
  end
57
63
  end
58
64
  raise MovableInk::AWS::Errors::FailedWithBackoff
@@ -1,5 +1,5 @@
1
1
  module MovableInk
2
2
  class AWS
3
- VERSION = '0.1.9'
3
+ VERSION = '0.1.10'
4
4
  end
5
5
  end
data/spec/aws_spec.rb CHANGED
@@ -41,6 +41,16 @@ describe MovableInk::AWS do
41
41
  aws.run_with_backoff { ec2.describe_instances } rescue nil
42
42
  end
43
43
 
44
+ it "should not retry and raise if a non-throttling error occurs" do
45
+ aws = MovableInk::AWS.new(environment: 'test')
46
+ route53 = Aws::Route53::Client.new(stub_responses: true)
47
+ route53.stub_responses(:list_resource_record_sets, 'NoSuchHostedZone')
48
+
49
+ expect(aws).to receive(:notify_slack).exactly(1).times
50
+ expect(STDOUT).to receive(:puts).exactly(1).times
51
+ expect{ aws.run_with_backoff { route53.list_resource_record_sets(hosted_zone_id: 'foo') } }.to raise_error(MovableInk::AWS::Errors::ServiceError)
52
+ end
53
+
44
54
  it "should not notify slack when quiet param is passed in" do
45
55
  aws = MovableInk::AWS.new(environment: 'test')
46
56
  ec2 = Aws::EC2::Client.new(stub_responses: true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MovableInkAWS
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Chesler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-12 00:00:00.000000000 Z
11
+ date: 2018-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk