cwmiller / broadworks-connector

Simple library for connecting to BroadWorks OCI-P API
MIT License
8 stars 5 forks source link

function help #10

Closed TwinMist closed 5 years ago

TwinMist commented 6 years ago

Hi trying to create a function this works function UserGetListInGroupRequest($ServiceProviderId,$GroupId) { global $ocip; $request = (new UserGetListInGroupRequest()) ->setServiceProviderId($ServiceProviderId) ->setGroupId($GroupId); $response = $ocip->call($request);

if ($response instanceof ErrorResponse) {
   return $response->getSummary();
} else {
    return $response;
}

} but how would you code it for catch (ErrorResponseException ?

thanks

cwmiller commented 5 years ago

That's all up to you. You could either not catch the Exception within the function and allow the caller to catch it. The alternative would be to catch the Exception within the function and return FALSE or some other value to indicate an error.