mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
11b2066922
Includes PHPDoc license tag in the file-level block with accompanying copyright notice. Also added an AUTHORS file on the off chance of outside contributions
18 lines
719 B
PHP
18 lines
719 B
PHP
<?php
|
|
/** @license MIT
|
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
|
* See LICENSE and AUTHORS files for details */
|
|
|
|
declare(strict_types=1);
|
|
namespace JKingWeb\Arsse\Feed;
|
|
|
|
class Exception extends \JKingWeb\Arsse\AbstractException {
|
|
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);
|
|
}
|
|
}
|