@@ 135-140 (lines=6) @@ | ||
132 | // The deployment was successful |
|
133 | return json_decode($response->body); |
|
134 | ||
135 | case 409 : |
|
136 | // There was a merge conflict or a status check failed. |
|
137 | $body = json_decode($response->body); |
|
138 | $message = isset($body->message) ? $body->message : 'Invalid response received from GitHub.'; |
|
139 | ||
140 | throw new \RuntimeException($message, $response->code); |
|
141 | ||
142 | default : |
|
143 | throw new \UnexpectedValueException('Unexpected response code: ' . $response->code); |
@@ 67-74 (lines=8) @@ | ||
64 | throw new \UnexpectedValueException('Nothing to merge'); |
|
65 | break; |
|
66 | ||
67 | case '404': |
|
68 | // Missing base or Missing head response |
|
69 | $error = json_decode($response->body); |
|
70 | ||
71 | $message = (isset($error->message)) ? $error->message : 'Missing base or head: ' . $response->code; |
|
72 | ||
73 | throw new \UnexpectedValueException($message); |
|
74 | break; |
|
75 | ||
76 | case '409': |
|
77 | // Merge conflict response |
|
@@ 76-83 (lines=8) @@ | ||
73 | throw new \UnexpectedValueException($message); |
|
74 | break; |
|
75 | ||
76 | case '409': |
|
77 | // Merge conflict response |
|
78 | $error = json_decode($response->body); |
|
79 | ||
80 | $message = (isset($error->message)) ? $error->message : 'Merge conflict ' . $response->code; |
|
81 | ||
82 | throw new \UnexpectedValueException($message); |
|
83 | break; |
|
84 | ||
85 | default : |
|
86 | throw new \UnexpectedValueException('Unexpected response code: ' . $response->code); |