@@ -353,15 +353,9 @@ export async function insertMessageRecordWithRetries(
353353 { messageId : params . messageId , error, attempt } ,
354354 `Failed to save message after ${ maxRetries } attempts` ,
355355 )
356- // TODO: Consider removing this exception for test mode.
357- if ( process . env . NEXT_PUBLIC_CB_ENVIRONMENT === 'test' ) {
358- logger . error (
359- { messageId : params . messageId , error, attempt } ,
360- `(test mode) Couldn't fetch user cycle usage. Returning 0 consumed and 0 from purchased credits` ,
361- )
362- return null
363- }
364- throw error
356+ return null
357+ // TODO: Consider rethrowing the error, if we are losing too much money.
358+ // throw error
365359 } else {
366360 logger . warn (
367361 { messageId : params . messageId , error : error } ,
@@ -497,15 +491,10 @@ async function updateUserCycleUsageWithRetries(
497491 `Failed to update user cycle usage after ${ maxRetries } attempts` ,
498492 )
499493
500- // TODO: Consider removing this exception for test mode.
501- if ( process . env . NEXT_PUBLIC_CB_ENVIRONMENT === 'test' ) {
502- logger . error (
503- { userId, orgId, creditsUsed, error, attempt } ,
504- `(test mode) Couldn't fetch user cycle usage. Returning 0 consumed and 0 from purchased credits` ,
505- )
506- return { consumed : 0 , fromPurchased : 0 }
507- }
508- throw error
494+ return { consumed : 0 , fromPurchased : 0 }
495+
496+ // TODO: Consider rethrowing the error, if we are losing too much money.
497+ // throw error
509498 } else {
510499 logger . warn (
511500 { userId, orgId, creditsUsed, error : error } ,
0 commit comments