LabOrchestrator / LabOrchestratorLib

Library that contains the core of the lab orchestrator.
Mozilla Public License 2.0
2 stars 0 forks source link

add error handling to api #19

Open Bergiu opened 2 years ago

Bergiu commented 2 years ago

the return from api calls should be parsed and then checked if they were successfull. otherwise an error should be raised.

Bergiu commented 2 years ago

https://github.com/LabOrchestrator/LabOrchestratorLib/blob/main/src/lab_orchestrator_lib/kubernetes/api.py

this part should parse the response into a yaml object. if thats not possible raise an error. if it is possible to abstract this, the api should also check if the response was succesfull by checking attributes of the yaml. then it should return a boolean.

https://github.com/LabOrchestrator/LabOrchestratorLib/blob/main/src/lab_orchestrator_lib/controller/controller.py

after that, the controllers should contain a validation of the response and handle it. if something went wrong, the changes that were made should be reversed and another error should be raised