-
Notifications
You must be signed in to change notification settings - Fork 370
Silently crashes process on require() errors #331
Comments
Have you tried running with the debug environment variables set? All errors encountered should be logged. It's documented here: https://github.com/apigee-127/swagger-tools/blob/master/docs/Middleware.md#swagger-middleware-debugging |
Yes, this is related to #327. |
Yes: all that happens is that you see the line about 'Controllers:' and then it silently dies. That's why this fix. I've tested this fix with and without DEBUG set and confirmed the outputs from my examples are as expected. Sent from my iPhone
|
Though what I've just realised is that the spacing has gone mental when copy pasting from editor to editor >_< Sent from my iPhone
|
I appreciate the help. When you fix the formatting, just update the PR. |
It's fixed now. If you could let me know whenever this eventually makes it into an NPM release, I'd be much appreciative as it means we can ditch our locally patched version :) |
You got it. I really appreciate your help. |
It's the least I could do. For what its worth, I've also put up an example project I'm using when teaching people about microservices using swagger. You can find it at: https://github.com/node-templates/base-microservice-swagger It basically uses more or less every bit of middleware you've produced, though I'd be interested to see an example of how I can add API-key support to it if you get a moment, because I struggle slightly with how the security middleware works. |
This has been resolved. |
Hello,
The swagger-router when dynamically loading controllers during startup does not log any information regarding what happened. This causes the application process usually to exit silently under the following scenarios:
This *_may *_be related to the issues in #327, but has cost myself and my team a lot of time trying to figure out that the real issue was a downstream service connection not being able to start, causing a module to fail to load, etc etc.
-Steve
The text was updated successfully, but these errors were encountered: