Menu ▾ ▴

#3 Review the broad try..except blocks for what they hide

unread
nobody
design (2)
2026-09-27
2026-09-27
No

Measured on 2026-09-05: about 46 except blocks in the library catch every exception and let nothing out, e.g. try ... except Result := False end around file, graphics or registry operations. Such a block reports an EAccessViolation or EInvalidCast from dzlib's own code to the caller as "the operation did not succeed".

Per block, one of two: narrow it to the exception classes the outside world can cause (EStreamError, EInOutError, EOSError, ...) and let the rest travel on, or keep it and document in the doc comment which failures it absorbs. Blocks with the same body and cause are one change, e.g. ten near identical registry write blocks in u_dzVclUtils.

Also tracked as issue 88 in dzlib's ISSUES.md.

Discussion


Log in to post a comment.