Report proper error when an operation is invalid

This commit is contained in:
KernelDeimos
2024-04-15 22:27:03 -04:00
parent c07d0a2bc7
commit 653898b463
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -128,6 +128,10 @@ module.exports = class APIError {
return `Invalid id`;
}
},
'invalid_operation': {
status: 400,
message: ({ operation }) => `Invalid operation: ${quot(operation)}.`,
},
'field_invalid': {
status: 400,
message: ({ key, expected, got }) => {