@@ -33,12 +33,18 @@ trait CommonTrait
|
||||
return new Response(
|
||||
status: false,
|
||||
error: new Error(
|
||||
message: 'Unhandled exception was thrown in [{client}: {backend}] {action}. {message}',
|
||||
message: 'Exception [{error.kind}] was thrown unhandled in [{client}: {backend}] {action}. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'action' => $action ?? 'context',
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'message' => $e->getMessage(),
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
|
||||
@@ -232,9 +232,16 @@ final class ParseWebhook
|
||||
return new Response(
|
||||
status: false,
|
||||
error: new Error(
|
||||
message: 'Unhandled exception was thrown during [{backend}] webhook event parsing.',
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] webhook event parsing. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
|
||||
@@ -157,10 +157,17 @@ class Progress
|
||||
}
|
||||
} catch (\RuntimeException $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request to get [{backend}] {item.type} [{item.title}] status.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] get {item.type} [{item.title}] status. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
contexT: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
...$logContext,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
@@ -213,9 +220,16 @@ class Progress
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request to change [{backend}] {item.type} [{item.title}] watch progress.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] change {item.type} [{item.title}] watch progress. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -145,9 +145,16 @@ class Backup extends Import
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] [{library.title}] [{item.title}] backup.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] backup. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -237,9 +237,16 @@ class Export extends Import
|
||||
);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] [{library.title}] [{item.title}] export.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] export. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -71,9 +71,16 @@ class Import
|
||||
logContext: $logContext
|
||||
),
|
||||
error: fn(array $logContext = []) => fn(Throwable $e) => $this->logger->error(
|
||||
'Unhandled Exception was thrown during [{backend}] library [{library.title}] request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] library [{library.title}] request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -171,16 +178,26 @@ class Import
|
||||
Message::add("{$context->backendName}.has_errors", true);
|
||||
return [];
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error('Unhandled exception was thrown during request for [{backend}] libraries.', [
|
||||
'backend' => $context->backendName,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'kind' => get_class($e),
|
||||
'message' => $e->getMessage(),
|
||||
'trace' => $context->trace ? $e->getTrace() : [],
|
||||
],
|
||||
]);
|
||||
$this->logger->error(
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request for libraries. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'kind' => get_class($e),
|
||||
'message' => $e->getMessage(),
|
||||
'trace' => $context->trace ? $e->getTrace() : [],
|
||||
],
|
||||
]
|
||||
);
|
||||
Message::add("{$context->backendName}.has_errors", true);
|
||||
return [];
|
||||
}
|
||||
@@ -257,9 +274,16 @@ class Import
|
||||
continue;
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during [{backend}] [{library.title}] items count request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] items count request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -401,9 +425,16 @@ class Import
|
||||
continue;
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during [{backend}] [{library.title}] series external ids request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] series external ids request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -530,9 +561,16 @@ class Import
|
||||
continue;
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during [{backend}] [{library.title}] [{segment.number}/{segment.of}] content list request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] [{segment.number}/{segment.of}] content list request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -636,8 +674,8 @@ class Import
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during parsing of [{backend}] library [{library.title}] [{segment.number}/{segment.of}] response.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] parsing [{library.title}] [{segment.number}/{segment.of}] response. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
@@ -851,9 +889,16 @@ class Import
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] [{library.title}] [{item.title}] import.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] [{item.title}] import. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -216,9 +216,16 @@ final class ParseWebhook
|
||||
return new Response(
|
||||
status: false,
|
||||
error: new Error(
|
||||
message: 'Unhandled exception was thrown during [{backend}] webhook event parsing.',
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] webhook event parsing. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
|
||||
@@ -157,9 +157,16 @@ class Progress
|
||||
}
|
||||
} catch (\RuntimeException $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request to get [{backend}] {item.type} [{item.title}] status.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] get {item.type} [{item.title}] status. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -210,9 +217,16 @@ class Progress
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request to change [{backend}] {item.type} [{item.title}] watch progress.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] change {item.type} [{item.title}] watch progress. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -118,9 +118,16 @@ class Push
|
||||
);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request for [{backend}] {item.type} [{item.title}] metadata.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request for {item.type} [{item.title}] metadata. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -293,9 +300,16 @@ class Push
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] {item.type} [{item.title}].',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] parsing [{library.title}] [{segment.number}/{segment.of}] response. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -106,9 +106,16 @@ class JellyfinGuid implements iGuid
|
||||
} catch (Throwable $e) {
|
||||
if (true === $log) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown in parsing of [{backend}] [{agent}] identifier.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] parsing [{agent}] identifier. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $this->context->backendName,
|
||||
'client' => $this->context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'agent' => $value,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Backends\Jellyfin;
|
||||
|
||||
use App\Backends\Common\ManageInterface;
|
||||
use App\Libs\Options;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@@ -87,7 +88,7 @@ class JellyfinManage implements ManageInterface
|
||||
$this->output->writeln('');
|
||||
|
||||
// -- $backend.uuid
|
||||
(function () use (&$backend) {
|
||||
(function () use (&$backend, $opts) {
|
||||
try {
|
||||
$this->output->writeln(
|
||||
'<info>Attempting to automatically get the server unique identifier from API. Please wait...</info>'
|
||||
@@ -96,8 +97,9 @@ class JellyfinManage implements ManageInterface
|
||||
$custom = array_replace_recursive($backend, [
|
||||
'options' => [
|
||||
'client' => [
|
||||
'timeout' => 10
|
||||
]
|
||||
'timeout' => 20
|
||||
],
|
||||
Options::DEBUG_TRACE => (bool)ag($opts, Options::DEBUG_TRACE, false),
|
||||
]
|
||||
]);
|
||||
|
||||
@@ -166,7 +168,7 @@ class JellyfinManage implements ManageInterface
|
||||
$this->output->writeln('');
|
||||
|
||||
// -- $backend.user
|
||||
(function () use (&$backend) {
|
||||
(function () use (&$backend, $opts) {
|
||||
$chosen = ag($backend, 'user');
|
||||
|
||||
try {
|
||||
@@ -175,7 +177,15 @@ class JellyfinManage implements ManageInterface
|
||||
);
|
||||
|
||||
$list = $map = $ids = [];
|
||||
$custom = array_replace_recursive($backend, ['options' => ['client' => ['timeout' => 5]]]);
|
||||
|
||||
$custom = array_replace_recursive($backend, [
|
||||
'options' => [
|
||||
'client' => [
|
||||
'timeout' => 20
|
||||
],
|
||||
Options::DEBUG_TRACE => (bool)ag($opts, Options::DEBUG_TRACE, false),
|
||||
]
|
||||
]);
|
||||
|
||||
$users = makeBackend($custom, ag($custom, 'name'))->getUsersList();
|
||||
|
||||
|
||||
@@ -150,9 +150,16 @@ final class Backup extends Import
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] [{library.title}] [{item.title}] backup.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] backup. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -242,9 +242,16 @@ final class Export extends Import
|
||||
);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] [{library.title}] [{item.title}] export.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] backup. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -242,9 +242,16 @@ final class GetLibrary
|
||||
return new Response(
|
||||
status: false,
|
||||
error: new Error(
|
||||
message: 'Unhandled exception was thrown during request for [{backend}] {item.type} [{item.title}] metadata.',
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request for {item.type} [{item.title}] metadata. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
|
||||
@@ -209,9 +209,16 @@ final class GetUserToken
|
||||
return new Response(
|
||||
status: false,
|
||||
error: new Error(
|
||||
message: 'Unhandled exception was thrown during request for [{backend}] [{username}] access token.',
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request for [{username}] access token. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'username' => $username,
|
||||
'user_id' => $userId,
|
||||
'exception' => [
|
||||
|
||||
@@ -71,9 +71,16 @@ class Import
|
||||
logContext: $logContext
|
||||
),
|
||||
error: fn(array $logContext = []) => fn(Throwable $e) => $this->logger->error(
|
||||
'Unhandled Exception was thrown during [{backend}] library [{library.title}] request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] library [{library.title}] request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -176,16 +183,26 @@ class Import
|
||||
Message::add("{$context->backendName}.has_errors", true);
|
||||
return [];
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error('Unhandled exception was thrown during request for [{backend}] libraries.', [
|
||||
'backend' => $context->backendName,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'kind' => get_class($e),
|
||||
'message' => $e->getMessage(),
|
||||
'trace' => $context->trace ? $e->getTrace() : [],
|
||||
],
|
||||
]);
|
||||
$this->logger->error(
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request for libraries. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'kind' => get_class($e),
|
||||
'message' => $e->getMessage(),
|
||||
'trace' => $context->trace ? $e->getTrace() : [],
|
||||
],
|
||||
]
|
||||
);
|
||||
Message::add("{$context->backendName}.has_errors", true);
|
||||
return [];
|
||||
}
|
||||
@@ -310,9 +327,16 @@ class Import
|
||||
continue;
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during [{backend}] [{library.title}] items count request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] items count request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -481,9 +505,16 @@ class Import
|
||||
continue;
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during [{backend}] [{library.title}] [{segment.number}/{segment.of}] series external ids request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] [{segment.number}/{segment.of}] series external ids request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -617,9 +648,16 @@ class Import
|
||||
continue;
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during [{backend}] [{library.title}] [{segment.number}/{segment.of}] content list request.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] [{segment.number}/{segment.of}] content list request. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -715,9 +753,16 @@ class Import
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during parsing of [{backend}] library [{library.title}] [{segment.number}/{segment.of}] response.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] parsing of [{library.title}] [{segment.number}/{segment.of}] response. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -936,9 +981,16 @@ class Import
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] [{library.title}] [{item.title}] import.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] [{library.title}] [{item.title}] import. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -228,9 +228,16 @@ final class ParseWebhook
|
||||
return new Response(
|
||||
status: false,
|
||||
error: new Error(
|
||||
message: 'Unhandled exception was thrown during [{backend}] webhook event parsing.',
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] webhook event parsing. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
|
||||
@@ -162,9 +162,16 @@ class Progress
|
||||
}
|
||||
} catch (\RuntimeException $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request to get [{backend}] {item.type} [{item.title}] status.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request to get {item.type} [{item.title}] status. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -213,9 +220,16 @@ class Progress
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request to change [{backend}] {item.type} [{item.title}] watch progress.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request to change {item.type} [{item.title}] watch progress. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -105,9 +105,16 @@ final class Push
|
||||
);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during request for [{backend}] {item.type} [{item.title}] metadata.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] request for {item.type} [{item.title}] metadata. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
@@ -291,9 +298,16 @@ final class Push
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown during handling of [{backend}] {item.type} [{item.title}].',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] push. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $context->backendName,
|
||||
'client' => $context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$logContext,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -191,9 +191,16 @@ final class PlexGuid implements iGuid
|
||||
} catch (Throwable $e) {
|
||||
if (true === $log) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown in parsing of [{backend}] [{agent}] identifier.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] parsing [{agent}] identifier. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $this->context->backendName,
|
||||
'client' => $this->context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'agent' => $val,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
@@ -292,9 +299,16 @@ final class PlexGuid implements iGuid
|
||||
} catch (Throwable $e) {
|
||||
if (true === $log) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception was thrown in parsing of [{backend}] legacy agent [{agent}] identifier.',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{client}: {backend}] parsing legacy agent [{agent}] identifier. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'backend' => $this->context->backendName,
|
||||
'client' => $this->context->clientName,
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
'agent' => $guid,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -177,7 +177,7 @@ class PlexManage implements ManageInterface
|
||||
$this->output->writeln('');
|
||||
|
||||
// -- $backend.uuid
|
||||
(function () use (&$backend) {
|
||||
(function () use (&$backend, $opts) {
|
||||
try {
|
||||
$this->output->writeln(
|
||||
'<info>Attempting to automatically get the server unique identifier from API. Please wait...</info>'
|
||||
@@ -186,8 +186,9 @@ class PlexManage implements ManageInterface
|
||||
$custom = array_replace_recursive($backend, [
|
||||
'options' => [
|
||||
'client' => [
|
||||
'timeout' => 10
|
||||
]
|
||||
'timeout' => 20
|
||||
],
|
||||
Options::DEBUG_TRACE => (bool)ag($opts, Options::DEBUG_TRACE, false),
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
@@ -272,8 +272,8 @@ class RestoreCommand extends Command
|
||||
$this->logger->notice('Marked [{backend}] [{item.title}] as [{play_state}].', $context);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception thrown during request to change play state of [{backend}] {item.type} [{item.title}].',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{backend}] restore play state of {item.type} [{item.title}]. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
...$context,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -397,8 +397,14 @@ class ExportCommand extends Command
|
||||
$this->logger->notice('Marked [{backend}] [{item.title}] as [{play_state}].', $context);
|
||||
} catch (Throwable $e) {
|
||||
$this->logger->error(
|
||||
'Unhandled exception thrown during request to change play state of [{backend}] {item.type} [{item.title}].',
|
||||
[
|
||||
message: 'Exception [{error.kind}] was thrown unhandled during [{backend}] request to change play state of {item.type} [{item.title}]. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$context,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -221,8 +221,14 @@ class ProgressCommand extends Command
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logger->error(
|
||||
'SYSTEM: Unhandled exception thrown during request to change watch progress of [{backend}] {item.type} [{item.title}].',
|
||||
[
|
||||
message: 'SYSTEM: Exception [{error.kind}] was thrown unhandled during [{backend}] request to change watch progress of {item.type} [{item.title}]. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$context,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
@@ -199,8 +199,14 @@ class PushCommand extends Command
|
||||
$this->logger->notice('SYSTEM: Marked [{backend}] [{item.title}] as [{play_state}].', $context);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logger->error(
|
||||
'SYSTEM: Unhandled exception thrown during request to change play state of [{backend}] {item.type} [{item.title}].',
|
||||
[
|
||||
message: 'SYSTEM: Exception [{error.kind}] was thrown unhandled during [{backend}] request to change play state of {item.type} [{item.title}]. Error [{error.message} @ {error.file}:{error.line}].',
|
||||
context: [
|
||||
'error' => [
|
||||
'kind' => $e::class,
|
||||
'line' => $e->getLine(),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => after($e->getFile(), ROOT_PATH),
|
||||
],
|
||||
...$context,
|
||||
'exception' => [
|
||||
'file' => $e->getFile(),
|
||||
|
||||
Reference in New Issue
Block a user