Skip to content

Commit 02374bf

Browse files
authored
♻️ Improve exception handling in splitter (#506)
1 parent af50222 commit 02374bf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bibtexparser/splitter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ def split(self, library: Optional[Library] = None) -> Library:
291291
f"due to syntactical error in bibtex:\n {e.abort_reason}"
292292
)
293293
logger.info(
294-
"We will try to continue parsing, but this might lead to unexpected results."
295-
"The failed block will be stored in the `failed_blocks`of the library."
294+
"We will try to continue parsing, but this might lead to unexpected results. "
295+
"The failed block will be stored in the `failed_blocks` of the library."
296296
)
297297
library.add(
298298
ParsingFailedBlock(
@@ -308,14 +308,14 @@ def split(self, library: Optional[Library] = None) -> Library:
308308
"python-bibtexparser detected an invalid state. Please report this bug."
309309
)
310310
logger.error(e.message)
311-
raise e
312-
except Exception as e:
311+
raise
312+
except Exception:
313313
# For unknown exceptions, we want to fail hard and get the info in our issue tracker.
314314
logger.error(
315-
f"Unexpected exception while parsing `{m_val}` block (line {start_line})"
315+
f"Unexpected exception while parsing `{m_val}` block (line {start_line}). "
316316
"Please report this bug."
317317
)
318-
raise e
318+
raise
319319

320320
self._reset_block_status(current_char_index=self._current_char_index + 1)
321321
else:

0 commit comments

Comments
 (0)