2017-02-19 22:02:03 +00:00
|
|
|
<?php
|
2017-11-17 01:23:18 +00:00
|
|
|
/** @license MIT
|
|
|
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
|
|
|
* See LICENSE and AUTHORS files for details */
|
|
|
|
|
2017-02-19 22:02:03 +00:00
|
|
|
declare(strict_types=1);
|
2017-03-28 04:12:12 +00:00
|
|
|
namespace JKingWeb\Arsse\Feed;
|
2017-02-19 22:02:03 +00:00
|
|
|
|
2017-03-28 04:12:12 +00:00
|
|
|
class Exception extends \JKingWeb\Arsse\AbstractException {
|
2017-02-19 22:02:03 +00:00
|
|
|
public function __construct($url, \Throwable $e) {
|
|
|
|
$className = get_class($e);
|
|
|
|
// Convert the exception thrown by PicoFeed to the one to be thrown here.
|
|
|
|
$msgID = preg_replace('/^PicoFeed\\\(?:Client|Parser|Reader)\\\([A-Za-z]+)Exception$/', '$1', $className);
|
|
|
|
// If the message ID doesn't change then it's unknown.
|
|
|
|
$msgID = ($msgID !== $className) ? lcfirst($msgID) : '';
|
|
|
|
parent::__construct($msgID, ['url' => $url], $e);
|
|
|
|
}
|
2017-08-29 14:50:31 +00:00
|
|
|
}
|