These are chat archives for quorrajs/quorrajs

14th
Jun 2017
Theralos
@danilopolani
Jun 14 2017 07:50
Hi guys, I'm trying to throw a custom 500 error without the request ref, but with new Error("message") etc. it always renders the default 500 without my message
Harish
@harishanchu
Jun 14 2017 09:12
You must be doing something wrong there. If you are throwing a JavaScript error with message, you will detlfenitly see that in ouch error page.
Theralos
@danilopolani
Jun 14 2017 10:27

Ok, found out the error. I was throwing error from a method called by the primary method without a try/catch.

Wrong
mainMethod() -> otherMethod() -> throw

Correct
mainMethod() -> try/catch otherMethod()

Harish
@harishanchu
Jun 14 2017 16:50
Sorry, I didn't get you. If you throw an error in the Quorra app anywhere during the request life cycle it will be caught and displayed as an ouch error. This is done with the help of NodeJS domain. Here is the reference: https://github.com/quorrajs/Positron/blob/1.0/lib/foundation/Application.js#L128