Changeset 52244 for trunk/src/wp-includes/Requests/Exception/Http.php
- Timestamp:
- 11/25/2021 01:10:30 AM (5 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/Requests/Exception/Http.php
r52243 r52244 3 3 * Exception based on HTTP response 4 4 * 5 * @package Requests 5 * @package Requests\Exceptions 6 6 */ 7 8 namespace WpOrg\Requests\Exception; 9 10 use WpOrg\Requests\Exception; 11 use WpOrg\Requests\Exception\Http\StatusUnknown; 7 12 8 13 /** 9 14 * Exception based on HTTP response 10 15 * 11 * @package Requests 16 * @package Requests\Exceptions 12 17 */ 13 class Requests_Exception_HTTP extends Requests_Exception {18 class Http extends Exception { 14 19 /** 15 20 * HTTP status code … … 45 50 46 51 /** 47 * Get the status message 52 * Get the status message. 53 * 54 * @return string 48 55 */ 49 56 public function getReason() { … … 59 66 public static function get_class($code) { 60 67 if (!$code) { 61 return 'Requests_Exception_HTTP_Unknown';68 return StatusUnknown::class; 62 69 } 63 70 64 $class = sprintf(' Requests_Exception_HTTP_%d', $code);71 $class = sprintf('\WpOrg\Requests\Exception\Http\Status%d', $code); 65 72 if (class_exists($class)) { 66 73 return $class; 67 74 } 68 75 69 return 'Requests_Exception_HTTP_Unknown';76 return StatusUnknown::class; 70 77 } 71 78 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)