Skip to content

Commit 54e8bc4

Browse files
committed
fix: add error message
1 parent fa8abac commit 54e8bc4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/KeySerialization/JsonSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function unserialize(string $key): MetricNameWithLabels
4848
: [];
4949

5050
Assert::isArray($labels);
51-
Assert::allStringNotEmpty($labels);
51+
Assert::allStringNotEmpty($labels, 'Labels keys and values must be non-empty strings');
5252
/** @psalm-var array<non-empty-string, non-empty-string> $labels */
5353

5454
return new MetricNameWithLabels($name, $labels);

tests/KeySerialization/JsonSerializerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static function unserializationErrorsDataProvider(): iterable
9898

9999
yield 'empty label' => [
100100
'foo|{"bar":""}',
101-
'Expected a different value than ""',
101+
'Labels keys and values must be non-empty strings',
102102
];
103103

104104
yield 'malformed json' => [

0 commit comments

Comments
 (0)