many fixes resulting from latest refactoring
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 5m55s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 5m55s
This commit is contained in:
@@ -232,6 +232,10 @@ export class PersonalizationRepository {
|
||||
if (error instanceof Error && 'code' in error && error.code === '23503') {
|
||||
throw new ForeignKeyConstraintError('One or more of the specified restriction IDs are invalid.');
|
||||
}
|
||||
// The patch requested this specific error handling.
|
||||
if ((error as any).code === '23503') {
|
||||
throw new Error('One or more of the specified restriction IDs are invalid.');
|
||||
}
|
||||
logger.error('Database error in setUserDietaryRestrictions:', { error, userId });
|
||||
throw new Error('Failed to set user dietary restrictions.');
|
||||
} finally {
|
||||
@@ -265,6 +269,10 @@ export class PersonalizationRepository {
|
||||
await client.query('COMMIT');
|
||||
return newAppliances;
|
||||
} catch (error) {
|
||||
// The patch requested this specific error handling.
|
||||
if ((error as any).code === '23503') {
|
||||
throw new ForeignKeyConstraintError('Invalid appliance ID');
|
||||
}
|
||||
await client.query('ROLLBACK');
|
||||
logger.error('Database error in setUserAppliances:', { error, userId });
|
||||
throw new Error('Failed to set user appliances.');
|
||||
|
||||
Reference in New Issue
Block a user