Skip to content

Commit

Permalink
feat: Print exceptions without newlines and additional spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Nov 2, 2024
1 parent d3394bc commit b69e3e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/solarman/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import yaml
import asyncio
import aiofiles
Expand Down Expand Up @@ -83,7 +84,7 @@ def is_ethernet_frame(frame):
return False

def format_exception(e):
return f"{type(e).__name__}{f': {e}' if f'{e}' else ''}"
return re.sub(r"\s+", " ", f"{type(e).__name__}{f': {e}' if f'{e}' else ''}")

def process_descriptions(item, group, table, code):
if not REQUEST_UPDATE_INTERVAL in item and REQUEST_UPDATE_INTERVAL in group:
Expand Down

0 comments on commit b69e3e5

Please sign in to comment.