Closed lazar-eric closed 5 years ago
@lazar-eric Attempting to create a new organization with an existing public key is crashing the server. This should be a known application error, but obviously we shouldn't crash the server with 'process.exit(1);' for unknown errors either. Anything unknown should be logged/sent to Sentry and the user should get a generic unknown exception message.
Let's use kebab-case for files to keep it consistent (ie: express-errorhandler.middleware.ts).
What about just error-handler.middleware.ts?
{{url}}/organization/request/0xc0ffee254729296a45a3885639AC7E10F9d54979
{
"meta": {
"message": "Invalid data: address should be string",
"code": 400
}
}
This is what I'm seeing if I disable the unhandledRejection listener.
(node:5608) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'params' of undefined
at Object.<anonymous> (/Users/conor/projects/ambrosus-node-extended/src/middleware/validation.middleware.ts:29:17)
at Generator.next (<anonymous>)
at /Users/conor/projects/ambrosus-node-extended/src/middleware/validation.middleware.ts:7:71
at new Promise (<anonymous>)
at __awaiter (/Users/conor/projects/ambrosus-node-extended/src/middleware/validation.middleware.ts:3:12)
at /Users/conor/projects/ambrosus-node-extended/src/middleware/validation.middleware.ts:9:68
This isn't a user error, it's an error to notify the developer that they haven't implemented the subclass correctly.
{
"meta": {
"message": "Repository error: timestampField getter must be overridden!",
"code": 400
}
}
Feel free to merge.
In the postman project 'Get Organization' fails validation. The param integer seems to be the issue.
GET http://localhost:3000/organization/27
Result
Same for 'Get Organization Accounts' and 'Modify Organization'