1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00
Arsse/lib/Feed/Exception.php
Dustin Wilson e5d825d360 Started integration of PicoFeed
• Integrated PicoFeed into Database->subscriptionAdd
• Added exception handling for feeds
• Added static method for formatting SQL dates into Db/Common
2017-02-19 16:02:03 -06:00

14 lines
No EOL
610 B
PHP

<?php
declare(strict_types=1);
namespace JKingWeb\NewsSync\Feed;
class Exception extends \JKingWeb\NewsSync\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);
}
}