exoscale / cs

A simple, yet powerful CloudStack API client for python and the command-line.
BSD 3-Clause "New" or "Revised" License
88 stars 36 forks source link

client: refactor exceptions #93

Closed greut closed 5 years ago

greut commented 5 years ago

When the error occurs before reaching CloudStack, the reason is often hidden by the fact that the answer isn't in the expected application/json

Before

cs.deployVirtualMachine(userdata="...")

CloudStackException("JSON (application/json) was expected, got 'text/html'")

After

cs.deployVirtualMachine(userdata="...")

CloudStackException('HTTP 414 Request-URI Too Large', "Make sure endpoint URL 'https://ppapi.exoscale.ch/compute' is correct.")