diff options
| author | Jack Koenig | 2021-05-14 11:12:19 -0700 |
|---|---|---|
| committer | GitHub | 2021-05-14 18:12:19 +0000 |
| commit | c2d72fd8a4f3558094094eed2f4a12f85d080c41 (patch) | |
| tree | 6da2b363ae2af6639ff0a8b8aae05410711934fb /src/main/scala/firrtl/Compiler.scala | |
| parent | f33b93101e0e623dc345b27f18520fd5a5ca921d (diff) | |
Add JsonProtocol.serializeRecover (#2227)
This function will safely wrap any unserializeable annotations in
UnserializeableAnnotations so that they can be safely serialized to JSON
for logging.
Diffstat (limited to 'src/main/scala/firrtl/Compiler.scala')
| -rw-r--r-- | src/main/scala/firrtl/Compiler.scala | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/main/scala/firrtl/Compiler.scala b/src/main/scala/firrtl/Compiler.scala index 2998af3c..7354b8ee 100644 --- a/src/main/scala/firrtl/Compiler.scala +++ b/src/main/scala/firrtl/Compiler.scala @@ -214,17 +214,7 @@ private[firrtl] object Transform { val remappedAnnotations = propagateAnnotations(name, logger, before.annotations, after.annotations, after.renames) logger.trace(s"Annotations:") - logger.trace { - JsonProtocol - .serializeTry(remappedAnnotations) - .recoverWith { - case NonFatal(e) => - val msg = s"Exception thrown during Annotation serialization:\n " + - e.toString.replaceAll("\n", "\n ") - Try(msg) - } - .get - } + logger.trace(JsonProtocol.serializeRecover(remappedAnnotations)) logger.trace(s"Circuit:\n${after.circuit.serialize}") |
