mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-29 00:26:44 +00:00
Report proper error when an operation is invalid
This commit is contained in:
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user