Supress exception errors

Hello everyone,

How can i suppress the exception errors in the response? Because, i don’t want to see any exception message on the response. For example, if my service raises some exception, below response is returned from load balancer. But, i want to return that just specific error message or someting else.

{"zato_env": {"details": "Traceback (most recent call last):\n  File \"\/opt\/zato\/2.0.7\/zato-server\/src\/zato\/server\/connection\/http_soap\/channel.py\", line 198, in dispatch\n    payload, worker_store, self.simple_io_config, post_data)\n  File \"\/opt\/zato\/2.0.7\/zato-server\/src\/zato\/server\/connection\/http_soap\/channel.py\", line 350, in handle\n    params_priority=channel_item.params_pri)\n  File \"\/opt\/zato\/2.0.7\/zato-server\/src\/zato\/server\/service\/__init__.py\", line 428, in update_handle\n    raise Exception(exc_formatted)\nException: Traceback (most recent call last):\n  File \"\/opt\/zato\/2.0.7\/zato-server\/src\/zato\/server\/service\/__init__.py\", line 401, in update_handle\n    self._invoke(service, channel)\n  File \"\/opt\/zato\/2.0.7\/zato-server\/src\/zato\/server\/service\/__init__.py\", line 344, in _invoke\n    service.handle()\n  File \"\/opt\/zato\/env\/server\/work\/hot-deploy\/current\/create_system.py\", line 27, in handle\n    raise KeyError\nKeyError\n\n", "result": "ZATO_ERROR", "cid": "K07MKJ6ZGCZDNH96Q365YDK2CM7Z"}}

Hi @halitalptekin,

this was reported before as an issue and I lean towards interpteting it as such. Consequently, in 2.0.8 and 3.0, there are new options in server.conf called:

  • misc.return_tracebacks
  • misc.default_error_message

If you’d like to use it in earlier versions, please apply patch from the GitHub ticket below to your installation and set misc.return_tracebacks to False. Then, misc.default_error_message, will control what message to return instead of the traceback.

Thank you for reply, but i think this feature is not available for the debian repository. Do you think to update the debian repo with the up-to-date github codes?

Hello @halitalptekin - yes, this is not included in the .deb repository yet. It will be done in the next patch release (2.0.8).

For now, if this is a priority for you, please apply the patches from this GitHub ticket: