Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
97570291
Commit
97570291
authored
Jul 11, 2014
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`yii\authclient\InvalidResponseException` added
parent
a1a9d9a3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
BaseOAuth.php
extensions/authclient/BaseOAuth.php
+1
-1
CHANGELOG.md
extensions/authclient/CHANGELOG.md
+1
-0
InvalidResponseException.php
extensions/authclient/InvalidResponseException.php
+45
-0
No files found.
extensions/authclient/BaseOAuth.php
View file @
97570291
...
...
@@ -201,7 +201,7 @@ abstract class BaseOAuth extends BaseClient implements ClientInterface
throw
new
Exception
(
'Curl error requesting "'
.
$url
.
'": #'
.
$errorNumber
.
' - '
.
$errorMessage
);
}
if
(
$responseHeaders
[
'http_code'
]
!=
200
)
{
throw
new
Exception
(
'Request failed with code: '
.
$responseHeaders
[
'http_code'
]
.
', message: '
.
$response
);
throw
new
InvalidResponseException
(
$responseHeaders
,
$response
,
'Request failed with code: '
.
$responseHeaders
[
'http_code'
]
.
', message: '
.
$response
);
}
return
$this
->
processResponse
(
$response
,
$this
->
determineContentTypeByHeaders
(
$responseHeaders
));
...
...
extensions/authclient/CHANGELOG.md
View file @
97570291
...
...
@@ -7,6 +7,7 @@ Yii Framework 2 authclient extension Change Log
-
Bug #3633: OpenId return URL comparison advanced to prevent url encode problem (klimov-paul)
-
Enh #3416: VKontakte OAuth support added (klimov-paul)
-
Enh #4076: Request HTTP headers argument added to
`yii\authclient\BaseOAuth::api()`
method (klimov-paul)
-
Enh #4134:
`yii\authclient\InvalidResponseException`
added for tracking invalid remote server response (klimov-paul)
-
Enh #4139: User attributes requesting at GoogleOAuth switched to Google+ API (klimov-paul)
...
...
extensions/authclient/InvalidResponseException.php
0 → 100644
View file @
97570291
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\authclient
;
use
yii\base\Exception
;
/**
* InvalidResponseException represents an exception caused by invalid remote server response.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
class
InvalidResponseException
extends
Exception
{
/**
* @var array response headers.
*/
public
$responseHeaders
=
[];
/**
* @var string response body.
*/
public
$responseBody
=
''
;
/**
* Constructor.
* @param array $responseHeaders response headers
* @param string $responseBody response body
* @param string $message error message
* @param integer $code error code
* @param \Exception $previous The previous exception used for the exception chaining.
* @internal param int $status HTTP status code, such as 404, 500, etc.
*/
public
function
__construct
(
$responseHeaders
,
$responseBody
,
$message
=
null
,
$code
=
0
,
\Exception
$previous
=
null
)
{
$this
->
responseBody
=
$responseBody
;
$this
->
responseHeaders
=
$responseHeaders
;
parent
::
__construct
(
$message
,
$code
,
$previous
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment