ndb 1.13.2 → 1.14.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ndb/errors.rb +59 -1
  3. data/lib/ndb/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31c254744a2a99f1f7aab98641637d5e5c72ecf0368720c7b57722301d42b8c8
4
- data.tar.gz: 9c626e98c3fcbff0c6e0b2889bb283ac397f0b541ff70e040fe19c6ea091bcfb
3
+ metadata.gz: 93cdea704230998affb631c26c1e58c25fb7780d04931dbc9a922c939f24de99
4
+ data.tar.gz: ee1d7ba1a796530dda545c5076aab587b4512cab13c47d3eba4290e19d1c992e
5
5
  SHA512:
6
- metadata.gz: 82651b170132f83fbafbe1900de9d13780ac961d3c7725226343d5a4fbacffba657fcbd537f63e14ce0cdd9bba56e6dfb28b4612d81dcbb9f6e9de3a6aa3bfc4
7
- data.tar.gz: 5a0f1364de9b2f02f05779c2463d4ee3bfc8da9d1dced25e793a47592fe0ccea9a19748a1a0165e8605dd432c9c24d18acac3584b811d91e192952654df1078e
6
+ metadata.gz: 845cb4a57d3637bbe59978997f123c0ece7b6bbbc39136499e5e3e315384db3a4f80b4554a7e4c1d7f61b3f36b1f6e2517023f8406307ff23f463b2ec41fa6aa
7
+ data.tar.gz: 5cb673f8fb02a3c10be40af8b084997dd12ce21aab3f09ce0ad0ca5c8fb4e2dd9b041c5f86527e56f958166ac4eab9d69f029b5b949130638e5e3eb9b386e43d
data/lib/ndb/errors.rb CHANGED
@@ -68,6 +68,41 @@ module Ndb
68
68
  # attaches too many documents.
69
69
  class LookupError < Error; end
70
70
 
71
+ # The daemon refused a token for this route, or a route over TCP.
72
+ class Forbidden < Error; end
73
+
74
+ # A document, an id, a batch, a path or an index definition is not valid.
75
+ class InvalidDocument < Error; end
76
+
77
+ # A collection pattern that is not valid, a write on one, or one that
78
+ # matches too many collections.
79
+ class InvalidPattern < Error; end
80
+
81
+ # The route does not exist for a direct-mode collection.
82
+ class NotSupported < Error; end
83
+
84
+ # The blob reference is not sha256:<64 hex>.
85
+ class InvalidBlobRef < Error; end
86
+
87
+ # No route has this path, or not with this method.
88
+ class UnknownRoute < Error; end
89
+
90
+ # The group table of an aggregate is over its memory limit.
91
+ class GroupLimitExceeded < Error; end
92
+
93
+ # The body or one line is over max_line_size (or the blob limit).
94
+ class RequestTooLarge < Error; end
95
+
96
+ # The watch position is not valid.
97
+ class InvalidPosition < Error; end
98
+
99
+ # The daemon is shutting down (HTTP 503). Not retried by the client: the
100
+ # request may have been taken, unlike NotReady.
101
+ class Closed < Error; end
102
+
103
+ # A bug or a disk error in the daemon; the message is in its log.
104
+ class Internal < Error; end
105
+
71
106
  # The daemon error code -> the Ruby class.
72
107
  CODE_TO_ERROR = {
73
108
  "unauthorized" => Unauthorized,
@@ -100,7 +135,30 @@ module Ndb
100
135
  "pitr_off" => PitrOff,
101
136
  "lookup_invalid" => LookupError,
102
137
  "lookup_unindexed" => LookupError,
103
- "lookup_too_large" => LookupError
138
+ "lookup_too_large" => LookupError,
139
+ "invalid_pipeline" => InvalidQuery,
140
+ "forbidden" => Forbidden,
141
+ "invalid_doc" => InvalidDocument,
142
+ "missing_id" => InvalidDocument,
143
+ "invalid_id" => InvalidDocument,
144
+ "immutable_id" => InvalidDocument,
145
+ "invalid_batch" => InvalidDocument,
146
+ "invalid_path" => InvalidDocument,
147
+ "invalid_index" => InvalidDocument,
148
+ "invalid_pattern" => InvalidPattern,
149
+ "pattern_read_only" => InvalidPattern,
150
+ "pattern_too_wide" => InvalidPattern,
151
+ "not_supported" => NotSupported,
152
+ "invalid_blob_ref" => InvalidBlobRef,
153
+ "unknown_route" => UnknownRoute,
154
+ "method_not_allowed" => UnknownRoute,
155
+ "group_limit_exceeded" => GroupLimitExceeded,
156
+ "request_too_large" => RequestTooLarge,
157
+ "line_too_large" => RequestTooLarge,
158
+ "invalid_position" => InvalidPosition,
159
+ "closed" => Closed,
160
+ "stopping" => Closed,
161
+ "internal" => Internal
104
162
  }.freeze
105
163
 
106
164
  def self.error_for(code, message, status)
data/lib/ndb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ndb
4
- VERSION = "1.13.2"
4
+ VERSION = "1.14.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.2
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thadeu