droxit / roxcomposer

This is the droxit microservice framework repository.
GNU Lesser General Public License v3.0
5 stars 0 forks source link

Validate service JSON params and provide corresponding error messages. #102

Open hecktor-droxit opened 5 years ago

hecktor-droxit commented 5 years ago

Not all parameters in service JSON are validated providing a corresponding error message. For example, an invalid path parameter is correctly reported back to the user. An invalid IP, however, leads to a server crash without any message in CLI.

hecktor-droxit commented 5 years ago

Trying to start topic_matcher with IP 127.0.0.h:

Traceback (most recent call last): File "/home/christian/Projekte/jotb-services/services/topic_matcher.py", line 128, in service = TopicMatcher(kwargs) File "/home/christian/Projekte/jotb-services/services/topic_matcher.py", line 87, in init super().init(params) File "/home/christian/Projekte/jotb-services/services/json_base_service.py", line 23, in init self.listen() File "/home/christian/.local/lib/python3.6/site-packages/roxcomposer/base_service.py", line 236, in listen self.listen_to(self.params['ip'], self.params['port']) File "/home/christian/.local/lib/python3.6/site-packages/roxcomposer/base_service.py", line 173, in listen_to raise e File "/home/christian/.local/lib/python3.6/site-packages/roxcomposer/base_service.py", line 169, in listen_to s.bind((ip, port)) socket.gaierror: [Errno -2] Name or service not known

heller-droxit commented 5 years ago

Check service parameters and return errors