Skip to content

Commit

Permalink
catch non-serializable objects
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Dec 29, 2023
1 parent 256b66c commit 77dd801
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Projection/Projection/Store/ErrorSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ public static function serialize(Throwable|null $error): string|null
return null;
}

return serialize($error);
try {
return @serialize($error);
} catch (Throwable) {
return null;
}
}

public static function unserialize(string|null $error): Throwable|null
Expand Down

0 comments on commit 77dd801

Please sign in to comment.