diff --git a/irrd/mirroring/nrtm4/nrtm4_client.py b/irrd/mirroring/nrtm4/nrtm4_client.py index 807be4e7..41cbec41 100644 --- a/irrd/mirroring/nrtm4/nrtm4_client.py +++ b/irrd/mirroring/nrtm4/nrtm4_client.py @@ -188,8 +188,14 @@ def _deserialize_unf(self, unf_content: str) -> tuple[bytes, str]: " client-clear-known-keys' command." ) raise NRTM4ClientError(msg) - error_messages = [f"; attempting {key} resulted in error: {ve}" for key, ve in errors.items()] - raise NRTM4ClientError(f"{self.source}: No valid signature found for any known keys{error_messages}") + + error_messages = [ + "; attempting '" + key.replace("\n", "\\n") + f"' resulted in error: '{ve}'" + for key, ve in errors.items() + ] + raise NRTM4ClientError( + f"{self.source}: No valid signature found for any known keys{''.join(error_messages)}" + ) def _current_db_status(self) -> tuple[bool, NRTM4ClientDatabaseStatus]: """Look up the current status of self.source in the database."""