Merge pull request #465 from shikorism/feature/metadata-error

メタデータ取得エラーの記録とリトライ制限の適用
This commit is contained in:
shibafu authored and GitHub committed 2020-08-22 09:34:58 +09:00
commit 3bb2b9afe0
7 files changed
+361 -24

No files matched your search

@@ -0,0 +1,16 @@
<?php
namespace App\MetadataResolver;
use Throwable;
/**
* 規定回数以上の解決失敗により、メタデータの取得が不能となっている場合にスローされます。
*/
class ResolverCircuitBreakException extends \RuntimeException
{
public function __construct(int $errorCount, string $url, Throwable $previous = null)
{
parent::__construct("{$errorCount}回失敗しているためメタデータの取得を中断しました: {$url}", 0, $previous);
}
}
@@ -0,0 +1,10 @@
<?php
namespace App\MetadataResolver;
/**
* MetadataResolver内で未キャッチの例外が発生した場合にスローされます。
*/
class UncaughtResolverException extends \RuntimeException
{
}