Browse Source

Guard against all exceptions when processing a line

You never know what's in the input string, so catch all possible
failures without crashing the tool.

Related-Bug: #1672921
Change-Id: I3a518be2e6087d0a096fa3c36aa40dcad8aecb98
Ihar Hrachyshka 2 years ago
parent
commit
881b6fd359
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      oslogmerger/oslogmerger.py

+ 3
- 3
oslogmerger/oslogmerger.py View File

@@ -217,9 +217,9 @@ class LogFile(object):
217 217
                     return entry, new_entry
218 218
                 entry = new_entry
219 219
 
220
-            except ValueError:
221
-                # it's a non-dated line, just append to the entry
222
-                # extra info
220
+            except Exception:
221
+                # it's probably a non-dated line, or a garbled entry, just
222
+                # append to the entry extra info
223 223
                 if entry:
224 224
                     entry.append_line(line)
225 225
 

Loading…
Cancel
Save