How to perform an efficient error treatment in Fluent interfaces?

Asked

Viewed 7 times

1

I went up in Gibhub the repository Siebel-server-manager, my proposal is to create a simple and objective wrapper that abstracts some tasks performed via CMD (Microsoft Windows Command Prompt).

In this initial stage the proposal boils down to a very simple structure, composed basically of two classes (Client and Component). I’m having trouble performing the error treatment while calling the method execCommand (in src Component.php).

To simulate the scenario, simply set the connection string to point to a non-existent binary. Inside the class Client method execCommand I have a treatment that returns an array containing the status and error message, however, due to the chaining of the Fluent interface, I could not devise an efficient strategy to treat the return and prevent track messages from popping on the screen.

I would appreciate any suggestion/guidance to resolve this impasse.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.