kosa8 0.5.2 → 0.6.0

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.
data/lib/kosa8/errors.rb CHANGED
@@ -29,6 +29,9 @@ module Kosa8
29
29
  @path = path
30
30
  @body = body
31
31
  @code = code
32
+ @detail = nil
33
+ @retry_after = nil
34
+ @request_id = nil
32
35
  end
33
36
 
34
37
  # The message: the server's own sentence (or the SDK's), followed for a
@@ -164,7 +167,7 @@ module Kosa8
164
167
  FAILURE_CLASSES = %w[ok exit_nonzero timeout oom infra quota client].freeze
165
168
  INFRA_CODES = %w[host_failed not_ready no_capacity host_unreachable host_unavailable host_busy host_restarting
166
169
  wake_failed try_again internal kernel_failed egress_failed dns_unreachable host_lost host_removed
167
- insufficient_storage starting].freeze
170
+ insufficient_storage starting database_busy].freeze
168
171
  RATE_CODES = %w[rate_limited slow_down too_soon].freeze
169
172
  QUOTA_CODES = %w[quota_exceeded running_limit plan_required plan_limit plan_feature payment_required payment_declined
170
173
  spending_cap_reached snapshot_limit org_frozen org_suspended too_many_runs].freeze
@@ -177,6 +180,9 @@ module Kosa8
177
180
  c = code.is_a?(String) ? code : ""
178
181
  return ["ok", false] if status < 400
179
182
  return ["timeout", false] if c == "exec_timeout"
183
+ return ["infra", true] if c == IDEMPOTENCY_IN_PROGRESS || c == "template_building"
184
+ # A bad parameter is the caller's to fix, whatever it names (invalid_timeout).
185
+ return ["client", false] if status < 500 && /\A(invalid|bad|missing|unknown)_/.match?(c)
180
186
  return ["timeout", true] if c.include?("timeout")
181
187
  return ["quota", true] if RATE_CODES.include?(c)
182
188
  return ["quota", false] if QUOTA_CODES.include?(c) || status == 402 || status == 423
data/lib/kosa8/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kosa8
4
- VERSION = "0.5.2"
4
+ VERSION = "0.6.0"
5
5
  end
data/lib/kosa8.rb CHANGED
@@ -11,5 +11,6 @@ require_relative "kosa8/client"
11
11
  require_relative "kosa8/cloud"
12
12
  require_relative "kosa8/cloud_features"
13
13
  require_relative "kosa8/cloud_rl"
14
+ require_relative "kosa8/cloud_more"
14
15
  require_relative "kosa8/fork_map"
15
16
  require_relative "kosa8/rl"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kosa8
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kosa8
@@ -25,6 +25,7 @@ files:
25
25
  - lib/kosa8/client.rb
26
26
  - lib/kosa8/cloud.rb
27
27
  - lib/kosa8/cloud_features.rb
28
+ - lib/kosa8/cloud_more.rb
28
29
  - lib/kosa8/cloud_rl.rb
29
30
  - lib/kosa8/errors.rb
30
31
  - lib/kosa8/fork_map.rb