diff options
Diffstat (limited to 'lib/facebook-graph-sdk/src/Facebook/Exceptions')
-rw-r--r-- | lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php | 11 | ||||
-rw-r--r-- | lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResumableUploadException.php | 35 |
2 files changed, 45 insertions, 1 deletions
diff --git a/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php b/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php index 4a135db..e51f1c8 100644 --- a/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php +++ b/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php @@ -90,11 +90,20 @@ class FacebookResponseException extends FacebookSDKException // Video upload resumable error case 1363030: case 1363019: - case 1363037: case 1363033: case 1363021: case 1363041: return new static($response, new FacebookResumableUploadException($message, $code)); + case 1363037: + $previousException = new FacebookResumableUploadException($message, $code); + + $startOffset = isset($data['error']['error_data']['start_offset']) ? (int) $data['error']['error_data']['start_offset'] : null; + $previousException->setStartOffset($startOffset); + + $endOffset = isset($data['error']['error_data']['end_offset']) ? (int) $data['error']['error_data']['end_offset'] : null; + $previousException->setEndOffset($endOffset); + + return new static($response, $previousException); } } diff --git a/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResumableUploadException.php b/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResumableUploadException.php index 6f47066..6d41c63 100644 --- a/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResumableUploadException.php +++ b/lib/facebook-graph-sdk/src/Facebook/Exceptions/FacebookResumableUploadException.php @@ -30,4 +30,39 @@ namespace Facebook\Exceptions; */ class FacebookResumableUploadException extends FacebookSDKException { + protected $startOffset; + + protected $endOffset; + + /** + * @return int|null + */ + public function getStartOffset() + { + return $this->startOffset; + } + + /** + * @param int|null $startOffset + */ + public function setStartOffset($startOffset) + { + $this->startOffset = $startOffset; + } + + /** + * @return int|null + */ + public function getEndOffset() + { + return $this->endOffset; + } + + /** + * @param int|null $endOffset + */ + public function setEndOffset($endOffset) + { + $this->endOffset = $endOffset; + } } |