apigee-127 / swagger-node-runner

The heart of Swagger-Node
MIT License
102 stars 124 forks source link

Adds static500Error config option to hide 500 error messages from clients #93

Closed EnigmaCurry closed 7 years ago

EnigmaCurry commented 7 years ago

I wanted to hide 500 error messages from my clients, not just the stacktrace, but the message text itself. Not being familiar with this code, this seemed the most obvious way. I added a static500Error option to the config.

My configuration adds a static 'Internal Server Error' message:

_json_error_handler:
  name: json_error_handler
  handle500Errors: true
  static500Error: Internal Server Error
  includeErrStack: false

swagger_controllers:
  - onError: _json_error_handler
  - cors
  - swagger_params_parser
  - swagger_security
  - _swagger_validate
  - express_compatibility
  - _router
coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 96.044% when pulling f8d06d98bdefc3c5606f9859126657c0d59b0628 on EnigmaCurry:static-500-error into 129ded602a4470a6d62fc6910a51f7c579e43374 on theganyo:master.

EnigmaCurry commented 7 years ago

Maybe this is still a good idea, I'm not sure, but I'm abandoning it for my own custom error handler fitting on my app.

theganyo commented 7 years ago

Honestly, that's what I expected folks to do for this.