Improved logging when encountering unexpected content type. Update #239
This commit is contained in:
@@ -137,7 +137,7 @@ final class ParseWebhook
|
||||
)
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ class Backup extends Import
|
||||
|
||||
try {
|
||||
if ($context->trace) {
|
||||
$this->logger->debug('Processing [%(backend)] %(item.type) payload.', [
|
||||
$this->logger->debug('Processing [%(backend)] payload.', [
|
||||
'backend' => $context->backendName,
|
||||
...$logContext,
|
||||
'payload' => $item,
|
||||
@@ -60,7 +60,7 @@ class Backup extends Import
|
||||
)
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -35,13 +35,13 @@ class Export extends Import
|
||||
|
||||
try {
|
||||
if ($context->trace) {
|
||||
$this->logger->debug('Processing [%(backend)] %(item.type) payload.', [
|
||||
$this->logger->debug('Processing [%(backend)] payload.', [
|
||||
'backend' => $context->backendName,
|
||||
...$logContext,
|
||||
'body' => $item,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$queue = ag($opts, 'queue', fn() => Container::get(QueueRequests::class));
|
||||
$after = ag($opts, 'after', null);
|
||||
|
||||
@@ -64,7 +64,7 @@ class Export extends Import
|
||||
)
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -707,7 +707,7 @@ class Import
|
||||
|
||||
try {
|
||||
if ($context->trace) {
|
||||
$this->logger->debug('Processing [%(backend)] %(item.type) payload.', [
|
||||
$this->logger->debug('Processing [%(backend)] payload.', [
|
||||
'backend' => $context->backendName,
|
||||
...$logContext,
|
||||
'body' => $item
|
||||
@@ -734,7 +734,7 @@ class Import
|
||||
)
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -115,7 +115,7 @@ final class ParseWebhook
|
||||
)
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -62,7 +62,7 @@ trait JellyfinActionTrait
|
||||
str_pad((string)ag($item, 'IndexNumber', 0), 3, '0', STR_PAD_LEFT),
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ final class Backup extends Import
|
||||
|
||||
try {
|
||||
if ($context->trace) {
|
||||
$this->logger->debug('Processing [%(backend)] %(item.type) payload.', [
|
||||
$this->logger->debug('Processing [%(backend)] payload.', [
|
||||
'backend' => $context->backendName,
|
||||
...$logContext,
|
||||
'payload' => $item,
|
||||
@@ -63,7 +63,7 @@ final class Backup extends Import
|
||||
str_pad((string)ag($item, 'index', 0), 3, '0', STR_PAD_LEFT),
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -40,13 +40,13 @@ final class Export extends Import
|
||||
|
||||
try {
|
||||
if ($context->trace) {
|
||||
$this->logger->debug('Processing [%(backend)] %(item.type) payload.', [
|
||||
$this->logger->debug('Processing [%(backend)] payload.', [
|
||||
'backend' => $context->backendName,
|
||||
...$logContext,
|
||||
'body' => $item,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Message::increment("{$context->backendName}.{$library}.total");
|
||||
Message::increment("{$context->backendName}.{$mappedType}.total");
|
||||
|
||||
@@ -70,7 +70,7 @@ final class Export extends Import
|
||||
str_pad((string)ag($item, 'index', 0), 3, '0', STR_PAD_LEFT),
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -718,7 +718,7 @@ class Import
|
||||
|
||||
try {
|
||||
if ($context->trace) {
|
||||
$this->logger->debug('Processing [%(backend)] %(item.type) [%(item.title)] payload.', [
|
||||
$this->logger->debug('Processing [%(backend)] payload.', [
|
||||
'backend' => $context->backendName,
|
||||
...$logContext,
|
||||
'body' => $item,
|
||||
@@ -748,7 +748,7 @@ class Import
|
||||
str_pad((string)ag($item, 'index', 0), 3, '0', STR_PAD_LEFT),
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -134,7 +134,7 @@ final class ParseWebhook
|
||||
str_pad((string)ag($item, 'index', 0), 3, '0', STR_PAD_LEFT),
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
@@ -80,7 +80,7 @@ trait PlexActionTrait
|
||||
str_pad((string)ag($item, 'index', 0), 3, '0', STR_PAD_LEFT),
|
||||
),
|
||||
default => throw new InvalidArgumentException(
|
||||
r('Invalid Content type [{type}] was given.', [
|
||||
r('Unexpected Content type [{type}] was received.', [
|
||||
'type' => $type
|
||||
])
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user