Error Response¶
-
class
moco_wrapper.util.response.ErrorResponse(response)¶ class for handling error messages returned by the api
-
data¶ Returns the text of the object (the error message itself)
-
is_recoverable¶ Checks the http status code of the response and returns True if the error is not a permanent error, i.e. recovering is possible by simply waiting a bit and sending the request again.
Type: bool Returns: Trueif recovery is possible by sending the request again later, otherwiseFalsem = Moco() project_id = 22 project_get = m.Project.get(project_id) if isinstance(project_get, ErrorResponse) and project_get.is_recoverable: time.sleep(5) project_get = m.Project.get(project_id) print(project_get)
-
response¶ http response object
-