This commit is contained in:
seb
2026-10-04 19:12:33 +02:00
parent a8e51724f8
commit a3926d3547
9 changed files with 165 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ function attributeErrorStatus(error) {
if (error.message === 'Name required') return 400;
if (error.message === 'Invalid attribute name order') return 400;
if (error.message === 'Invalid id') return 400;
if (error.message === 'Attribute name already exists') return 409;
if (error.message === 'Attribute name in use' || error.message?.includes('FOREIGN KEY constraint')) return 409;
return 500;
}

View File

@@ -16,6 +16,7 @@ function attributeValueErrorStatus(error) {
if (error.message === 'Value required') return 400;
if (error.message === 'Invalid attribute value order') return 400;
if (error.message === 'Invalid id' || error.message === 'Invalid attributeId') return 400;
if (error.message === 'Attribute value already exists') return 409;
if (error.message === 'Attribute value in use' || error.message?.includes('FOREIGN KEY constraint')) return 409;
return 500;
}

View File

@@ -17,6 +17,7 @@ function propertyErrorStatus(error) {
if (error.message === 'Name required') return 400;
if (error.message === 'Invalid property name order') return 400;
if (error.message === 'Invalid id') return 400;
if (error.message === 'Property name already exists') return 409;
if (error.message === 'Property name in use' || error.message?.startsWith('Cannot set property exclusive') || error.message?.includes('FOREIGN KEY constraint')) return 409;
return 500;
}