ZendServerSDK icon indicating copy to clipboard operation
ZendServerSDK copied to clipboard

listTargets when zsapi.ini is missing

Open zvikazend opened this issue 8 years ago • 0 comments

API automation should get a message and not exception, in order to parse and continue the flow. With no zsapi.ini, we get an exception instead of something like: ini files does not exist, or no targets found.

Error

$ zs-client.sh listTargets
Name           |            URL
--------------------------------
local => http://127.0.0.1:10081
$ rm /home/zvika/.zsapi.ini
$ zs-client.sh listTargets
======================================================================
   The application has thrown an exception!
======================================================================
 Zend\Config\Exception\RuntimeException
 File '/home/zvika/.zsapi.ini' doesn't exist or not readable

Manual fix

Do touch .zsapi.ini, command returns output with no records.

$ touch /home/zvika/.zsapi.ini
$ zs-client.sh listTargets
Name           |            URL
--------------------------------

Sort of an extension to issue #76 Thanks!

zvikazend avatar Apr 27 '17 11:04 zvikazend