cryptic-game / cryptic-service

The offical service microservice of Cryptic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validate MS return

tanneberger opened this issue · comments

Describe the bug
Function register_service does not validate if the return value from an other microservice is valid see this

To Reproduce
e.g just send an invalid device_uuid and it will crash.

Expected behavior , Solution
Something like this

temp: dict =  m.contact_microservice("device", ["hardware", "register"], {**r_data, **config["services"][name]["needs"], "user": user})
if "error" in temp:
     return temp
 given_per: Tuple[float, float, float, float, float] = game_content.dict2tuple(temp)