CMethodResultresult = someMethod(); if(result.isOk()){ int value = result.getResult(); // do something with value }else{ string error = result.getError(); // do something with error }
CMethodResultThis example shows how to use CMethodResult with a method that does not return a value. The isOk() method can be used to check if the call completed successfully. The library package name is "rho.apigenerator", which suggests that it is designed for generating APIs.result = anotherMethod(); if(result.isOk()){ // do something }else{ string error = result.getError(); // do something with error }