effect-app 4.0.0-beta.266 → 4.0.0-beta.267
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.
- package/CHANGELOG.md +8 -0
- package/dist/Model/Repository/Registry.d.ts +5 -4
- package/dist/Model/Repository/Registry.d.ts.map +1 -1
- package/dist/Model/Repository/Registry.js +1 -1
- package/dist/Model/Repository/ext.d.ts +3 -3
- package/dist/Model/Repository/legacy.d.ts +6 -6
- package/dist/Model/Repository/legacy.d.ts.map +1 -1
- package/dist/Model/Repository/service.d.ts +30 -30
- package/dist/Model/Repository/service.d.ts.map +1 -1
- package/dist/Store.d.ts +11 -11
- package/dist/Store.d.ts.map +1 -1
- package/dist/client/errors.d.ts +35 -4
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js +32 -2
- package/package.json +1 -1
- package/src/Model/Repository/Registry.ts +3 -2
- package/src/Model/Repository/legacy.ts +5 -5
- package/src/Model/Repository/service.ts +39 -29
- package/src/Store.ts +10 -10
- package/src/client/errors.ts +41 -1
package/src/client/errors.ts
CHANGED
|
@@ -157,6 +157,45 @@ export class OptimisticConcurrencyException extends TaggedErrorClass<OptimisticC
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Raised by a store adapter when a database operation fails for an
|
|
162
|
+
* infrastructure reason (request timeout, throttle, 5xx, dropped socket, or any
|
|
163
|
+
* non-conflict error). Distinct from `OptimisticConcurrencyException`, which is
|
|
164
|
+
* an expected etag conflict.
|
|
165
|
+
*
|
|
166
|
+
* `transient` is set by the adapter for failures worth retrying (timeout /
|
|
167
|
+
* throttle / 5xx / network). `cause` is the underlying adapter error, carried
|
|
168
|
+
* through a `Defect` schema so it serializes (an `Error` encodes to
|
|
169
|
+
* `{ name, message, cause }`) instead of breaking JSON encoding of the channel.
|
|
170
|
+
*
|
|
171
|
+
* Treated by the api/client/FE machinery like an unexpected (500-class) error.
|
|
172
|
+
*/
|
|
173
|
+
export class DatabaseError extends TaggedErrorClass<DatabaseError>()(
|
|
174
|
+
"DatabaseError",
|
|
175
|
+
{
|
|
176
|
+
message: S.String,
|
|
177
|
+
transient: S.Boolean,
|
|
178
|
+
cause: S.optional(S.Defect())
|
|
179
|
+
}
|
|
180
|
+
) {
|
|
181
|
+
constructor(
|
|
182
|
+
args: { message?: string; transient?: boolean; cause?: unknown },
|
|
183
|
+
disableValidation?: boolean
|
|
184
|
+
) {
|
|
185
|
+
super(
|
|
186
|
+
{
|
|
187
|
+
message: args.message ?? "Database operation failed",
|
|
188
|
+
transient: args.transient ?? false,
|
|
189
|
+
cause: args.cause
|
|
190
|
+
},
|
|
191
|
+
disableValidation as any
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
override toString() {
|
|
195
|
+
return `DatabaseError: ${this.message}`
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
160
199
|
const MutationOnlyErrors = [
|
|
161
200
|
InvalidStateError,
|
|
162
201
|
OptimisticConcurrencyException
|
|
@@ -168,7 +207,8 @@ const GeneralErrors = [
|
|
|
168
207
|
LoginError,
|
|
169
208
|
UnauthorizedError,
|
|
170
209
|
ValidationError,
|
|
171
|
-
ServiceUnavailableError
|
|
210
|
+
ServiceUnavailableError,
|
|
211
|
+
DatabaseError
|
|
172
212
|
] as const
|
|
173
213
|
|
|
174
214
|
export const SupportedErrors = S.Union([
|