Skip to content

listTargets when zsapi.ini is missing #96

@zvikazend

Description

@zvikazend

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions