@adaptic/backend-legacy 0.0.903 → 0.0.905
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/ABTest.cjs +291 -63
- package/Account.cjs +291 -63
- package/AccountLinkingRequest.cjs +291 -63
- package/Action.cjs +291 -63
- package/Alert.cjs +291 -63
- package/Allocation.cjs +291 -63
- package/AlpacaAccount.cjs +291 -63
- package/AnalyticsConfiguration.cjs +291 -63
- package/AnalyticsSnapshot.cjs +291 -63
- package/Asset.cjs +291 -63
- package/AuditLog.cjs +291 -63
- package/Authenticator.cjs +291 -63
- package/Configuration.cjs +291 -63
- package/ConflictEvent.cjs +291 -63
- package/ConnectionHealthSnapshot.cjs +291 -63
- package/Customer.cjs +291 -63
- package/DeadLetterMessage.cjs +291 -63
- package/EconomicEvent.cjs +291 -63
- package/Event.cjs +291 -63
- package/EventSnapshot.cjs +291 -63
- package/FeatureImportanceAnalysis.cjs +291 -63
- package/InstitutionalFlowSignal.cjs +291 -63
- package/InstitutionalHolding.cjs +291 -63
- package/InstitutionalSentimentAlerts.cjs +291 -63
- package/InstitutionalSentimentErrors.cjs +291 -63
- package/InstitutionalSentimentHistory.cjs +291 -63
- package/InstitutionalSentimentMetrics.cjs +291 -63
- package/InviteToken.cjs +291 -63
- package/LinkedProvider.cjs +291 -63
- package/MLTrainingData.cjs +291 -63
- package/MarketSentiment.cjs +291 -63
- package/ModelArtifact.cjs +291 -63
- package/ModelVersion.cjs +291 -63
- package/ModelVersionArtifact.cjs +291 -63
- package/NewsArticle.cjs +291 -63
- package/NewsArticleAssetSentiment.cjs +291 -63
- package/OptionsContract.cjs +291 -63
- package/OptionsGreeksHistory.cjs +291 -63
- package/OptionsPosition.cjs +291 -63
- package/OptionsTradeExecution.cjs +291 -63
- package/PortfolioGreeksHistory.cjs +291 -63
- package/ScheduledOptionOrder.cjs +291 -63
- package/Session.cjs +291 -63
- package/SignalGeneratorMetrics.cjs +291 -63
- package/SignalLineage.cjs +291 -63
- package/SignalOutcome.cjs +291 -63
- package/SignalPriorityQueue.cjs +291 -63
- package/SyncEvent.cjs +291 -63
- package/SystemAlert.cjs +291 -63
- package/Trade.cjs +291 -63
- package/TradeAuditEvent.cjs +291 -63
- package/TradeExecutionHistory.cjs +291 -63
- package/User.cjs +291 -63
- package/VerificationToken.cjs +291 -63
- package/WaitlistEntry.cjs +291 -63
- package/esm/ABTest.d.ts.map +1 -1
- package/esm/ABTest.js.map +1 -1
- package/esm/ABTest.mjs +255 -27
- package/esm/Account.d.ts.map +1 -1
- package/esm/Account.js.map +1 -1
- package/esm/Account.mjs +255 -27
- package/esm/AccountLinkingRequest.d.ts.map +1 -1
- package/esm/AccountLinkingRequest.js.map +1 -1
- package/esm/AccountLinkingRequest.mjs +255 -27
- package/esm/Action.d.ts.map +1 -1
- package/esm/Action.js.map +1 -1
- package/esm/Action.mjs +255 -27
- package/esm/Alert.d.ts.map +1 -1
- package/esm/Alert.js.map +1 -1
- package/esm/Alert.mjs +255 -27
- package/esm/Allocation.d.ts.map +1 -1
- package/esm/Allocation.js.map +1 -1
- package/esm/Allocation.mjs +255 -27
- package/esm/AlpacaAccount.d.ts.map +1 -1
- package/esm/AlpacaAccount.js.map +1 -1
- package/esm/AlpacaAccount.mjs +255 -27
- package/esm/AnalyticsConfiguration.d.ts.map +1 -1
- package/esm/AnalyticsConfiguration.js.map +1 -1
- package/esm/AnalyticsConfiguration.mjs +255 -27
- package/esm/AnalyticsSnapshot.d.ts.map +1 -1
- package/esm/AnalyticsSnapshot.js.map +1 -1
- package/esm/AnalyticsSnapshot.mjs +255 -27
- package/esm/Asset.d.ts.map +1 -1
- package/esm/Asset.js.map +1 -1
- package/esm/Asset.mjs +255 -27
- package/esm/AuditLog.d.ts.map +1 -1
- package/esm/AuditLog.js.map +1 -1
- package/esm/AuditLog.mjs +255 -27
- package/esm/Authenticator.d.ts.map +1 -1
- package/esm/Authenticator.js.map +1 -1
- package/esm/Authenticator.mjs +255 -27
- package/esm/Configuration.d.ts.map +1 -1
- package/esm/Configuration.js.map +1 -1
- package/esm/Configuration.mjs +255 -27
- package/esm/ConflictEvent.d.ts.map +1 -1
- package/esm/ConflictEvent.js.map +1 -1
- package/esm/ConflictEvent.mjs +255 -27
- package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
- package/esm/ConnectionHealthSnapshot.js.map +1 -1
- package/esm/ConnectionHealthSnapshot.mjs +255 -27
- package/esm/Customer.d.ts.map +1 -1
- package/esm/Customer.js.map +1 -1
- package/esm/Customer.mjs +255 -27
- package/esm/DeadLetterMessage.d.ts.map +1 -1
- package/esm/DeadLetterMessage.js.map +1 -1
- package/esm/DeadLetterMessage.mjs +255 -27
- package/esm/EconomicEvent.d.ts.map +1 -1
- package/esm/EconomicEvent.js.map +1 -1
- package/esm/EconomicEvent.mjs +255 -27
- package/esm/Event.d.ts.map +1 -1
- package/esm/Event.js.map +1 -1
- package/esm/Event.mjs +255 -27
- package/esm/EventSnapshot.d.ts.map +1 -1
- package/esm/EventSnapshot.js.map +1 -1
- package/esm/EventSnapshot.mjs +255 -27
- package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
- package/esm/FeatureImportanceAnalysis.js.map +1 -1
- package/esm/FeatureImportanceAnalysis.mjs +255 -27
- package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
- package/esm/InstitutionalFlowSignal.js.map +1 -1
- package/esm/InstitutionalFlowSignal.mjs +255 -27
- package/esm/InstitutionalHolding.d.ts.map +1 -1
- package/esm/InstitutionalHolding.js.map +1 -1
- package/esm/InstitutionalHolding.mjs +255 -27
- package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
- package/esm/InstitutionalSentimentAlerts.js.map +1 -1
- package/esm/InstitutionalSentimentAlerts.mjs +255 -27
- package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
- package/esm/InstitutionalSentimentErrors.js.map +1 -1
- package/esm/InstitutionalSentimentErrors.mjs +255 -27
- package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
- package/esm/InstitutionalSentimentHistory.js.map +1 -1
- package/esm/InstitutionalSentimentHistory.mjs +255 -27
- package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
- package/esm/InstitutionalSentimentMetrics.js.map +1 -1
- package/esm/InstitutionalSentimentMetrics.mjs +255 -27
- package/esm/InviteToken.d.ts.map +1 -1
- package/esm/InviteToken.js.map +1 -1
- package/esm/InviteToken.mjs +255 -27
- package/esm/LinkedProvider.d.ts.map +1 -1
- package/esm/LinkedProvider.js.map +1 -1
- package/esm/LinkedProvider.mjs +255 -27
- package/esm/MLTrainingData.d.ts.map +1 -1
- package/esm/MLTrainingData.js.map +1 -1
- package/esm/MLTrainingData.mjs +255 -27
- package/esm/MarketSentiment.d.ts.map +1 -1
- package/esm/MarketSentiment.js.map +1 -1
- package/esm/MarketSentiment.mjs +255 -27
- package/esm/ModelArtifact.d.ts.map +1 -1
- package/esm/ModelArtifact.js.map +1 -1
- package/esm/ModelArtifact.mjs +255 -27
- package/esm/ModelVersion.d.ts.map +1 -1
- package/esm/ModelVersion.js.map +1 -1
- package/esm/ModelVersion.mjs +255 -27
- package/esm/ModelVersionArtifact.d.ts.map +1 -1
- package/esm/ModelVersionArtifact.js.map +1 -1
- package/esm/ModelVersionArtifact.mjs +255 -27
- package/esm/NewsArticle.d.ts.map +1 -1
- package/esm/NewsArticle.js.map +1 -1
- package/esm/NewsArticle.mjs +255 -27
- package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/esm/NewsArticleAssetSentiment.js.map +1 -1
- package/esm/NewsArticleAssetSentiment.mjs +255 -27
- package/esm/OptionsContract.d.ts.map +1 -1
- package/esm/OptionsContract.js.map +1 -1
- package/esm/OptionsContract.mjs +255 -27
- package/esm/OptionsGreeksHistory.d.ts.map +1 -1
- package/esm/OptionsGreeksHistory.js.map +1 -1
- package/esm/OptionsGreeksHistory.mjs +255 -27
- package/esm/OptionsPosition.d.ts.map +1 -1
- package/esm/OptionsPosition.js.map +1 -1
- package/esm/OptionsPosition.mjs +255 -27
- package/esm/OptionsTradeExecution.d.ts.map +1 -1
- package/esm/OptionsTradeExecution.js.map +1 -1
- package/esm/OptionsTradeExecution.mjs +255 -27
- package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
- package/esm/PortfolioGreeksHistory.js.map +1 -1
- package/esm/PortfolioGreeksHistory.mjs +255 -27
- package/esm/ScheduledOptionOrder.d.ts.map +1 -1
- package/esm/ScheduledOptionOrder.js.map +1 -1
- package/esm/ScheduledOptionOrder.mjs +255 -27
- package/esm/Session.d.ts.map +1 -1
- package/esm/Session.js.map +1 -1
- package/esm/Session.mjs +255 -27
- package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
- package/esm/SignalGeneratorMetrics.js.map +1 -1
- package/esm/SignalGeneratorMetrics.mjs +255 -27
- package/esm/SignalLineage.d.ts.map +1 -1
- package/esm/SignalLineage.js.map +1 -1
- package/esm/SignalLineage.mjs +255 -27
- package/esm/SignalOutcome.d.ts.map +1 -1
- package/esm/SignalOutcome.js.map +1 -1
- package/esm/SignalOutcome.mjs +255 -27
- package/esm/SignalPriorityQueue.d.ts.map +1 -1
- package/esm/SignalPriorityQueue.js.map +1 -1
- package/esm/SignalPriorityQueue.mjs +255 -27
- package/esm/SyncEvent.d.ts.map +1 -1
- package/esm/SyncEvent.js.map +1 -1
- package/esm/SyncEvent.mjs +255 -27
- package/esm/SystemAlert.d.ts.map +1 -1
- package/esm/SystemAlert.js.map +1 -1
- package/esm/SystemAlert.mjs +255 -27
- package/esm/Trade.d.ts.map +1 -1
- package/esm/Trade.js.map +1 -1
- package/esm/Trade.mjs +255 -27
- package/esm/TradeAuditEvent.d.ts.map +1 -1
- package/esm/TradeAuditEvent.js.map +1 -1
- package/esm/TradeAuditEvent.mjs +255 -27
- package/esm/TradeExecutionHistory.d.ts.map +1 -1
- package/esm/TradeExecutionHistory.js.map +1 -1
- package/esm/TradeExecutionHistory.mjs +255 -27
- package/esm/User.d.ts.map +1 -1
- package/esm/User.js.map +1 -1
- package/esm/User.mjs +255 -27
- package/esm/VerificationToken.d.ts.map +1 -1
- package/esm/VerificationToken.js.map +1 -1
- package/esm/VerificationToken.mjs +255 -27
- package/esm/WaitlistEntry.d.ts.map +1 -1
- package/esm/WaitlistEntry.js.map +1 -1
- package/esm/WaitlistEntry.mjs +255 -27
- package/esm/middleware/audit-logger.d.ts +0 -7
- package/esm/middleware/audit-logger.d.ts.map +1 -1
- package/esm/middleware/audit-logger.js.map +1 -1
- package/esm/middleware/audit-logger.mjs +5 -3
- package/esm/prismaClient.d.ts.map +1 -1
- package/esm/prismaClient.js.map +1 -1
- package/esm/prismaClient.mjs +38 -9
- package/package.json +1 -1
- package/prismaClient.cjs +38 -9
package/NewsArticle.cjs
CHANGED
|
@@ -137,7 +137,7 @@ exports.NewsArticle = {
|
|
|
137
137
|
* @returns The created NewsArticle or null.
|
|
138
138
|
*/
|
|
139
139
|
async create(props, globalClient) {
|
|
140
|
-
var _a, _b, _c, _d, _e;
|
|
140
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
141
141
|
// Maximum number of retries for database connection issues
|
|
142
142
|
const MAX_RETRIES = 3;
|
|
143
143
|
let retryCount = 0;
|
|
@@ -332,21 +332,52 @@ exports.NewsArticle = {
|
|
|
332
332
|
}
|
|
333
333
|
catch (error) {
|
|
334
334
|
lastError = error;
|
|
335
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
336
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
337
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
338
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
339
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
340
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
341
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
342
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
343
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
344
|
+
if (isConstraintViolation) {
|
|
345
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
346
|
+
logger_1.logger.error("Non-retryable constraint violation in createOneNewsArticle", {
|
|
347
|
+
operation: 'createOneNewsArticle',
|
|
348
|
+
model: 'NewsArticle',
|
|
349
|
+
error: String(error),
|
|
350
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
351
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
352
|
+
isRetryable: false,
|
|
353
|
+
});
|
|
354
|
+
throw error;
|
|
355
|
+
}
|
|
335
356
|
// Check if this is a database connection error that we should retry
|
|
336
|
-
const isConnectionError = ((
|
|
337
|
-
((
|
|
338
|
-
((
|
|
339
|
-
((
|
|
340
|
-
(error.networkError && ((
|
|
357
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
358
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
359
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
360
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
361
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
341
362
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
342
363
|
retryCount++;
|
|
343
364
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
344
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
365
|
+
logger_1.logger.warn("Database connection error in createOneNewsArticle, retrying...", {
|
|
366
|
+
operation: 'createOneNewsArticle',
|
|
367
|
+
model: 'NewsArticle',
|
|
368
|
+
attempt: retryCount,
|
|
369
|
+
maxRetries: MAX_RETRIES,
|
|
370
|
+
});
|
|
345
371
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
346
372
|
continue;
|
|
347
373
|
}
|
|
348
|
-
// Log
|
|
349
|
-
logger_1.logger.error("Database
|
|
374
|
+
// Log structured error details and rethrow
|
|
375
|
+
logger_1.logger.error("Database create operation failed", {
|
|
376
|
+
operation: 'createOneNewsArticle',
|
|
377
|
+
model: 'NewsArticle',
|
|
378
|
+
error: String(error),
|
|
379
|
+
isRetryable: isConnectionError,
|
|
380
|
+
});
|
|
350
381
|
throw error;
|
|
351
382
|
}
|
|
352
383
|
}
|
|
@@ -361,7 +392,7 @@ exports.NewsArticle = {
|
|
|
361
392
|
* @returns The count of created records or null.
|
|
362
393
|
*/
|
|
363
394
|
async createMany(props, globalClient) {
|
|
364
|
-
var _a, _b, _c, _d, _e;
|
|
395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
365
396
|
// Maximum number of retries for database connection issues
|
|
366
397
|
const MAX_RETRIES = 3;
|
|
367
398
|
let retryCount = 0;
|
|
@@ -421,21 +452,52 @@ exports.NewsArticle = {
|
|
|
421
452
|
}
|
|
422
453
|
catch (error) {
|
|
423
454
|
lastError = error;
|
|
455
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
456
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
457
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
458
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
459
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
460
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
461
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
462
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
463
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
464
|
+
if (isConstraintViolation) {
|
|
465
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
466
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyNewsArticle", {
|
|
467
|
+
operation: 'createManyNewsArticle',
|
|
468
|
+
model: 'NewsArticle',
|
|
469
|
+
error: String(error),
|
|
470
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
471
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
472
|
+
isRetryable: false,
|
|
473
|
+
});
|
|
474
|
+
throw error;
|
|
475
|
+
}
|
|
424
476
|
// Check if this is a database connection error that we should retry
|
|
425
|
-
const isConnectionError = ((
|
|
426
|
-
((
|
|
427
|
-
((
|
|
428
|
-
((
|
|
429
|
-
(error.networkError && ((
|
|
477
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
478
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
479
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
480
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
481
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
430
482
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
431
483
|
retryCount++;
|
|
432
484
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
433
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
485
|
+
logger_1.logger.warn("Database connection error in createManyNewsArticle, retrying...", {
|
|
486
|
+
operation: 'createManyNewsArticle',
|
|
487
|
+
model: 'NewsArticle',
|
|
488
|
+
attempt: retryCount,
|
|
489
|
+
maxRetries: MAX_RETRIES,
|
|
490
|
+
});
|
|
434
491
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
435
492
|
continue;
|
|
436
493
|
}
|
|
437
|
-
// Log
|
|
438
|
-
logger_1.logger.error("Database
|
|
494
|
+
// Log structured error details and rethrow
|
|
495
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
496
|
+
operation: 'createManyNewsArticle',
|
|
497
|
+
model: 'NewsArticle',
|
|
498
|
+
error: String(error),
|
|
499
|
+
isRetryable: isConnectionError,
|
|
500
|
+
});
|
|
439
501
|
throw error;
|
|
440
502
|
}
|
|
441
503
|
}
|
|
@@ -450,7 +512,7 @@ exports.NewsArticle = {
|
|
|
450
512
|
* @returns The updated NewsArticle or null.
|
|
451
513
|
*/
|
|
452
514
|
async update(props, globalClient) {
|
|
453
|
-
var _a, _b, _c, _d, _e;
|
|
515
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
454
516
|
// Maximum number of retries for database connection issues
|
|
455
517
|
const MAX_RETRIES = 3;
|
|
456
518
|
let retryCount = 0;
|
|
@@ -1083,21 +1145,55 @@ exports.NewsArticle = {
|
|
|
1083
1145
|
}
|
|
1084
1146
|
catch (error) {
|
|
1085
1147
|
lastError = error;
|
|
1148
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1149
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1150
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1151
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1152
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1153
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1154
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1155
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1156
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1157
|
+
if (isConstraintViolation) {
|
|
1158
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1159
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOneNewsArticle", {
|
|
1160
|
+
operation: 'updateOneNewsArticle',
|
|
1161
|
+
model: 'NewsArticle',
|
|
1162
|
+
error: String(error),
|
|
1163
|
+
recordId: props.id,
|
|
1164
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1165
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1166
|
+
isRetryable: false,
|
|
1167
|
+
});
|
|
1168
|
+
throw error;
|
|
1169
|
+
}
|
|
1086
1170
|
// Check if this is a database connection error that we should retry
|
|
1087
|
-
const isConnectionError = ((
|
|
1088
|
-
((
|
|
1089
|
-
((
|
|
1090
|
-
((
|
|
1091
|
-
(error.networkError && ((
|
|
1171
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1172
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1173
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1174
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1175
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
1092
1176
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1093
1177
|
retryCount++;
|
|
1094
1178
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1095
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1179
|
+
logger_1.logger.warn("Database connection error in updateOneNewsArticle, retrying...", {
|
|
1180
|
+
operation: 'updateOneNewsArticle',
|
|
1181
|
+
model: 'NewsArticle',
|
|
1182
|
+
attempt: retryCount,
|
|
1183
|
+
maxRetries: MAX_RETRIES,
|
|
1184
|
+
recordId: props.id,
|
|
1185
|
+
});
|
|
1096
1186
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1097
1187
|
continue;
|
|
1098
1188
|
}
|
|
1099
|
-
// Log
|
|
1100
|
-
logger_1.logger.error("Database
|
|
1189
|
+
// Log structured error details and rethrow
|
|
1190
|
+
logger_1.logger.error("Database update operation failed", {
|
|
1191
|
+
operation: 'updateOneNewsArticle',
|
|
1192
|
+
model: 'NewsArticle',
|
|
1193
|
+
error: String(error),
|
|
1194
|
+
recordId: props.id,
|
|
1195
|
+
isRetryable: isConnectionError,
|
|
1196
|
+
});
|
|
1101
1197
|
throw error;
|
|
1102
1198
|
}
|
|
1103
1199
|
}
|
|
@@ -1112,7 +1208,7 @@ exports.NewsArticle = {
|
|
|
1112
1208
|
* @returns The updated NewsArticle or null.
|
|
1113
1209
|
*/
|
|
1114
1210
|
async upsert(props, globalClient) {
|
|
1115
|
-
var _a, _b, _c, _d, _e;
|
|
1211
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1116
1212
|
// Maximum number of retries for database connection issues
|
|
1117
1213
|
const MAX_RETRIES = 3;
|
|
1118
1214
|
let retryCount = 0;
|
|
@@ -1889,21 +1985,55 @@ exports.NewsArticle = {
|
|
|
1889
1985
|
}
|
|
1890
1986
|
catch (error) {
|
|
1891
1987
|
lastError = error;
|
|
1988
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1989
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1990
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1991
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1992
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1993
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1994
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1995
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1996
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1997
|
+
if (isConstraintViolation) {
|
|
1998
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1999
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOneNewsArticle", {
|
|
2000
|
+
operation: 'upsertOneNewsArticle',
|
|
2001
|
+
model: 'NewsArticle',
|
|
2002
|
+
error: String(error),
|
|
2003
|
+
recordId: props.id,
|
|
2004
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2005
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2006
|
+
isRetryable: false,
|
|
2007
|
+
});
|
|
2008
|
+
throw error;
|
|
2009
|
+
}
|
|
1892
2010
|
// Check if this is a database connection error that we should retry
|
|
1893
|
-
const isConnectionError = ((
|
|
1894
|
-
((
|
|
1895
|
-
((
|
|
1896
|
-
((
|
|
1897
|
-
(error.networkError && ((
|
|
2011
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
2012
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
2013
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
2014
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
2015
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
1898
2016
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1899
2017
|
retryCount++;
|
|
1900
2018
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1901
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2019
|
+
logger_1.logger.warn("Database connection error in upsertOneNewsArticle, retrying...", {
|
|
2020
|
+
operation: 'upsertOneNewsArticle',
|
|
2021
|
+
model: 'NewsArticle',
|
|
2022
|
+
attempt: retryCount,
|
|
2023
|
+
maxRetries: MAX_RETRIES,
|
|
2024
|
+
recordId: props.id,
|
|
2025
|
+
});
|
|
1902
2026
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1903
2027
|
continue;
|
|
1904
2028
|
}
|
|
1905
|
-
// Log
|
|
1906
|
-
logger_1.logger.error("Database
|
|
2029
|
+
// Log structured error details and rethrow
|
|
2030
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
2031
|
+
operation: 'upsertOneNewsArticle',
|
|
2032
|
+
model: 'NewsArticle',
|
|
2033
|
+
error: String(error),
|
|
2034
|
+
recordId: props.id,
|
|
2035
|
+
isRetryable: isConnectionError,
|
|
2036
|
+
});
|
|
1907
2037
|
throw error;
|
|
1908
2038
|
}
|
|
1909
2039
|
}
|
|
@@ -1918,7 +2048,7 @@ exports.NewsArticle = {
|
|
|
1918
2048
|
* @returns The count of created records or null.
|
|
1919
2049
|
*/
|
|
1920
2050
|
async updateMany(props, globalClient) {
|
|
1921
|
-
var _a, _b, _c, _d, _e;
|
|
2051
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1922
2052
|
// Maximum number of retries for database connection issues
|
|
1923
2053
|
const MAX_RETRIES = 3;
|
|
1924
2054
|
let retryCount = 0;
|
|
@@ -2551,21 +2681,52 @@ exports.NewsArticle = {
|
|
|
2551
2681
|
}
|
|
2552
2682
|
catch (error) {
|
|
2553
2683
|
lastError = error;
|
|
2684
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2685
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
2686
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
2687
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
2688
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
2689
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
2690
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
2691
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
2692
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
2693
|
+
if (isConstraintViolation) {
|
|
2694
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
2695
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyNewsArticle", {
|
|
2696
|
+
operation: 'updateManyNewsArticle',
|
|
2697
|
+
model: 'NewsArticle',
|
|
2698
|
+
error: String(error),
|
|
2699
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2700
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2701
|
+
isRetryable: false,
|
|
2702
|
+
});
|
|
2703
|
+
throw error;
|
|
2704
|
+
}
|
|
2554
2705
|
// Check if this is a database connection error that we should retry
|
|
2555
|
-
const isConnectionError = ((
|
|
2556
|
-
((
|
|
2557
|
-
((
|
|
2558
|
-
((
|
|
2559
|
-
(error.networkError && ((
|
|
2706
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
2707
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
2708
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
2709
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
2710
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
2560
2711
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2561
2712
|
retryCount++;
|
|
2562
2713
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2563
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2714
|
+
logger_1.logger.warn("Database connection error in updateManyNewsArticle, retrying...", {
|
|
2715
|
+
operation: 'updateManyNewsArticle',
|
|
2716
|
+
model: 'NewsArticle',
|
|
2717
|
+
attempt: retryCount,
|
|
2718
|
+
maxRetries: MAX_RETRIES,
|
|
2719
|
+
});
|
|
2564
2720
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2565
2721
|
continue;
|
|
2566
2722
|
}
|
|
2567
|
-
// Log
|
|
2568
|
-
logger_1.logger.error("Database
|
|
2723
|
+
// Log structured error details and rethrow
|
|
2724
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
2725
|
+
operation: 'updateManyNewsArticle',
|
|
2726
|
+
model: 'NewsArticle',
|
|
2727
|
+
error: String(error),
|
|
2728
|
+
isRetryable: isConnectionError,
|
|
2729
|
+
});
|
|
2569
2730
|
throw error;
|
|
2570
2731
|
}
|
|
2571
2732
|
}
|
|
@@ -2580,7 +2741,7 @@ exports.NewsArticle = {
|
|
|
2580
2741
|
* @returns The deleted NewsArticle or null.
|
|
2581
2742
|
*/
|
|
2582
2743
|
async delete(props, globalClient) {
|
|
2583
|
-
var _a, _b, _c, _d, _e;
|
|
2744
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
2584
2745
|
// Maximum number of retries for database connection issues
|
|
2585
2746
|
const MAX_RETRIES = 3;
|
|
2586
2747
|
let retryCount = 0;
|
|
@@ -2624,21 +2785,58 @@ exports.NewsArticle = {
|
|
|
2624
2785
|
}
|
|
2625
2786
|
catch (error) {
|
|
2626
2787
|
lastError = error;
|
|
2788
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2789
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
2790
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
2791
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
2792
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
2793
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
2794
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
2795
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
2796
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
2797
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
2798
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
2799
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
2800
|
+
if (isConstraintViolation) {
|
|
2801
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
2802
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOneNewsArticle", {
|
|
2803
|
+
operation: 'deleteOneNewsArticle',
|
|
2804
|
+
model: 'NewsArticle',
|
|
2805
|
+
error: String(error),
|
|
2806
|
+
recordId: props.id,
|
|
2807
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2808
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2809
|
+
isRetryable: false,
|
|
2810
|
+
});
|
|
2811
|
+
throw error;
|
|
2812
|
+
}
|
|
2627
2813
|
// Check if this is a database connection error that we should retry
|
|
2628
|
-
const isConnectionError = ((
|
|
2629
|
-
((
|
|
2630
|
-
((
|
|
2631
|
-
((
|
|
2632
|
-
(error.networkError && ((
|
|
2814
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
2815
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
2816
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
2817
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
2818
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
2633
2819
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2634
2820
|
retryCount++;
|
|
2635
2821
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2636
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2822
|
+
logger_1.logger.warn("Database connection error in deleteOneNewsArticle, retrying...", {
|
|
2823
|
+
operation: 'deleteOneNewsArticle',
|
|
2824
|
+
model: 'NewsArticle',
|
|
2825
|
+
attempt: retryCount,
|
|
2826
|
+
maxRetries: MAX_RETRIES,
|
|
2827
|
+
recordId: props.id,
|
|
2828
|
+
});
|
|
2637
2829
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2638
2830
|
continue;
|
|
2639
2831
|
}
|
|
2640
|
-
// Log
|
|
2641
|
-
logger_1.logger.error("Database
|
|
2832
|
+
// Log structured error details and rethrow
|
|
2833
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
2834
|
+
operation: 'deleteOneNewsArticle',
|
|
2835
|
+
model: 'NewsArticle',
|
|
2836
|
+
error: String(error),
|
|
2837
|
+
recordId: props.id,
|
|
2838
|
+
isRetryable: isConnectionError,
|
|
2839
|
+
});
|
|
2642
2840
|
throw error;
|
|
2643
2841
|
}
|
|
2644
2842
|
}
|
|
@@ -2709,12 +2907,22 @@ exports.NewsArticle = {
|
|
|
2709
2907
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2710
2908
|
retryCount++;
|
|
2711
2909
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2712
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2910
|
+
logger_1.logger.warn("Database connection error in getNewsArticle, retrying...", {
|
|
2911
|
+
operation: 'getNewsArticle',
|
|
2912
|
+
model: 'NewsArticle',
|
|
2913
|
+
attempt: retryCount,
|
|
2914
|
+
maxRetries: MAX_RETRIES,
|
|
2915
|
+
});
|
|
2713
2916
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2714
2917
|
continue;
|
|
2715
2918
|
}
|
|
2716
|
-
// Log
|
|
2717
|
-
logger_1.logger.error("Database
|
|
2919
|
+
// Log structured error details and rethrow
|
|
2920
|
+
logger_1.logger.error("Database get operation failed", {
|
|
2921
|
+
operation: 'getNewsArticle',
|
|
2922
|
+
model: 'NewsArticle',
|
|
2923
|
+
error: String(error),
|
|
2924
|
+
isRetryable: isConnectionError,
|
|
2925
|
+
});
|
|
2718
2926
|
throw error;
|
|
2719
2927
|
}
|
|
2720
2928
|
}
|
|
@@ -2772,12 +2980,22 @@ exports.NewsArticle = {
|
|
|
2772
2980
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2773
2981
|
retryCount++;
|
|
2774
2982
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2775
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2983
|
+
logger_1.logger.warn("Database connection error in getAllNewsArticle, retrying...", {
|
|
2984
|
+
operation: 'getAllNewsArticle',
|
|
2985
|
+
model: 'NewsArticle',
|
|
2986
|
+
attempt: retryCount,
|
|
2987
|
+
maxRetries: MAX_RETRIES,
|
|
2988
|
+
});
|
|
2776
2989
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2777
2990
|
continue;
|
|
2778
2991
|
}
|
|
2779
|
-
// Log
|
|
2780
|
-
logger_1.logger.error("Database
|
|
2992
|
+
// Log structured error details and rethrow
|
|
2993
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
2994
|
+
operation: 'getAllNewsArticle',
|
|
2995
|
+
model: 'NewsArticle',
|
|
2996
|
+
error: String(error),
|
|
2997
|
+
isRetryable: isConnectionError,
|
|
2998
|
+
});
|
|
2781
2999
|
throw error;
|
|
2782
3000
|
}
|
|
2783
3001
|
}
|
|
@@ -2857,12 +3075,22 @@ exports.NewsArticle = {
|
|
|
2857
3075
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2858
3076
|
retryCount++;
|
|
2859
3077
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2860
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
3078
|
+
logger_1.logger.warn("Database connection error in findManyNewsArticle, retrying...", {
|
|
3079
|
+
operation: 'findManyNewsArticle',
|
|
3080
|
+
model: 'NewsArticle',
|
|
3081
|
+
attempt: retryCount,
|
|
3082
|
+
maxRetries: MAX_RETRIES,
|
|
3083
|
+
});
|
|
2861
3084
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2862
3085
|
continue;
|
|
2863
3086
|
}
|
|
2864
|
-
// Log
|
|
2865
|
-
logger_1.logger.error("Database
|
|
3087
|
+
// Log structured error details and rethrow
|
|
3088
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
3089
|
+
operation: 'findManyNewsArticle',
|
|
3090
|
+
model: 'NewsArticle',
|
|
3091
|
+
error: String(error),
|
|
3092
|
+
isRetryable: isConnectionError,
|
|
3093
|
+
});
|
|
2866
3094
|
throw error;
|
|
2867
3095
|
}
|
|
2868
3096
|
}
|