You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if you look at sendRequest() more close that it can return only:
Some data (JSON or file body)
true
Exception
In example above we don't expect data, thus it means our function can return only true.
Such "contract" may confuse end-developer. If i see return bool then i add if () then statement in code. But actually i should add try catch.
So we should review SDK methods and remove return statement if it returns only a single value. Let's refactor only Jobs API because we don't use it yet.
DoD:
Update following methods:
createJob
updateJob
cancelJob
listJobs
getJob
authorizeJob
addFileToJob
Update method documentation. Make it clear that it doesn't return value, but may throw exception
I noticed that all functions that call
BaseApiAbstract->sendRequest()
returnbool
. An example,But if you look at
sendRequest()
more close that it can return only:true
In example above we don't expect data, thus it means our function can return only
true
.Such "contract" may confuse end-developer. If i see
return bool
then i addif () then
statement in code. But actually i should addtry catch
.So we should review SDK methods and remove
return
statement if it returns only a single value. Let's refactor only Jobs API because we don't use it yet.DoD:
The text was updated successfully, but these errors were encountered: