just a quick how to for using guzzle and handling exceptions with logging and rethrow.
clone the repository and run composer install to get all dependencies.
each file makes a different request to a server and will handle each exception type differently. Look at the files for how they are handled.