Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Raise WhmConnectionError when cPanel API is unavailable #103

Merged
merged 1 commit into from
Sep 22, 2015

Conversation

mzahir
Copy link
Contributor

@mzahir mzahir commented Sep 22, 2015

There are some scenarios where cPanel stops accepting API requests (such as when the root filesystem is full). However, HTML is sent back in the JSON response, causing a JSON::ParseError.

JSON::ParserError: 757: unexpected token at 'Content-type: text/plain; charset="utf-8" <html> <body bgcolor="#FFFFFF"> <h1>Sorry for the inconvenience!</h1> <h3>The filesystem mounted at / on this server is running out of disk space. cPanel operations have been temporarily suspended to prevent something bad from happening. Please ask your system admin to remove any files not in use on that partition.</h3> </body> </html>'

With this change, a WhmConnectionError is raised instead.

@boone
Copy link
Contributor

boone commented Sep 22, 2015

👍

ruyrocha pushed a commit that referenced this pull request Sep 22, 2015
Raise WhmConnectionError when cPanel API is unavailable
@ruyrocha ruyrocha merged commit 12af0f3 into envato-archive:master Sep 22, 2015
@mzahir mzahir deleted the fix/unavailable branch September 22, 2015 15:38
@mzahir mzahir restored the fix/unavailable branch October 2, 2015 01:47
@mzahir mzahir deleted the fix/unavailable branch October 2, 2015 01:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants