Skip to content

Commit 75853e1

Browse files
authored
Do not re-alias SerializationException (#154)
1 parent fbc1283 commit 75853e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sync/functions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
use Amp\Serialization\SerializationException as SerializerException;
66

7-
// Alias must be defined in an always-loaded file as catch blocks do not trigger the autoloader.
8-
\class_alias(SerializerException::class, SerializationException::class);
7+
if (!\class_exists(SerializationException::class)) {
8+
// Alias must be defined in an always-loaded file as catch blocks do not trigger the autoloader.
9+
\class_alias(SerializerException::class, SerializationException::class);
10+
}
911

1012
/**
1113
* @param \Throwable $exception

0 commit comments

Comments
 (0)