Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

'statusCode' is undefined in Services/Errors/error.service.js #7

Closed
Yokutto opened this issue Jul 15, 2020 · 1 comment · Fixed by #8
Closed

'statusCode' is undefined in Services/Errors/error.service.js #7

Yokutto opened this issue Jul 15, 2020 · 1 comment · Fixed by #8
Labels
bug Something isn't working

Comments

@Yokutto
Copy link

Yokutto commented Jul 15, 2020

Hi,

I recently installed enlighten in my API and everything stopped working when an error occurs. I was wondering that something could be wrong with my API, so I installed enlighten on a newly created NestJS API and the results were the same. I couldn't fix this problem myself, so I'm here asking for your help, I'll leave the problem stack below

(node:5252) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'statusCode' of undefined
    at ErrorService.errorDeterminator (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/nestjs-enlighten/dist/Services/Errors/error.service.js:10:55)
    at ViewCompilerService.getCompiledView (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/nestjs-enlighten/dist/Services/ViewCompiler/view-compiler.service.js:16:78)
    at ExceptionFilter.catch (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/nestjs-enlighten/dist/Filters/exception.filter.js:31:77)
    at ExceptionsHandler.invokeCustomFilters (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/@nestjs/core/exceptions/exceptions-handler.js:33:26)
    at ExceptionsHandler.next (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/@nestjs/core/exceptions/exceptions-handler.js:13:18)
    at /home/mokyunnetwork/Gitlab/nestjs-api/node_modules/@nestjs/core/router/router-proxy.js:24:35
    at Layer.handle_error (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/express/lib/router/index.js:315:13)
    at /home/mokyunnetwork/Gitlab/nestjs-api/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/mokyunnetwork/Gitlab/nestjs-api/node_modules/express/lib/router/index.js:335:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:5252) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:5252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Node version: v14.4.0
NestJS version: 7.4.1
Enlighten version: 0.0.4-beta

@onur-ozkan
Copy link
Owner

@Yokutto Thanks for your feedback, will be working on it this weekend.

@onur-ozkan onur-ozkan added the bug Something isn't working label Jul 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants