Handling exception on 504 Error

When load balancer/proxy return 504, client raises ValueError.
This happen when response is not a JSON object.
ValueError Exception is needed to be handled.

Change-Id: Iaa8d577f99137327f6e7ad9c7c6abc350f4cc938
Closes-Bug: #1358889
Merge "Handling exception on 504 Error"