Skip to content

Commit 1aa9a48

Browse files
author
kbehrman
committed
Merge pull request shotgunsoftware#15 from shotgunsoftware/maint_mode_error
Maint mode error
2 parents 32ec775 + 629d30a commit 1aa9a48

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

shotgun_api3/shotgun.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,14 @@ def _call_rpc(self, method, params, include_script_name=True, first=False):
11701170
}
11711171
http_status, resp_headers, body = self._make_call("POST",
11721172
self.config.api_path, encoded_payload, req_headers)
1173-
LOG.debug("Completed rpc call to %s" % (method))
1173+
LOG.debug("Completed rpc call to %s" % (method))
1174+
try:
1175+
self._parse_http_status(http_status)
1176+
except ProtocolError, e:
1177+
if e.errcode == 503:
1178+
e.reason = "Shotgun is currently down for maintenance. Please try again later."
1179+
raise
11741180

1175-
self._parse_http_status(http_status)
11761181
response = self._decode_response(resp_headers, body)
11771182
self._response_errors(response)
11781183
response = self._transform_inbound(response)
@@ -1303,6 +1308,8 @@ def _parse_http_status(self, status):
13031308

13041309
if status[0] >= 300:
13051310
msg = "HTTP error from server"
1311+
if status[0] == 503:
1312+
reason = "Shotgun is currently down for maintenance. Please try again later."
13061313
raise ProtocolError(self.config.server,
13071314
error_code,
13081315
reason,

0 commit comments

Comments
 (0)