Skip to content

OTP29 compat - #128

Merged
mworrell merged 1 commit into
masterfrom
otp29
Sep 20, 2026
Merged

mworrell merged 1 commit into
masterfrom
otp29

Conversation

@mworrell

Copy link
Copy Markdown
Member

This pull request improves error handling throughout the codebase by replacing the use of catch with more robust try ... catch constructs, ensuring more precise error matching and better stacktrace reporting. Additionally, it updates CI dependencies and enhances test coverage for error scenarios.

Error handling improvements:

  • Replaced catch with try ... catch in z_convert.erl for to_utc/1 and to_localtime/1, allowing for more granular error and exit handling when converting between local and UTC times. [1] [2]
  • Updated nows_protocol_split/2 in z_html.erl to use try ... catch for binary-to-integer conversion, specifically catching badarg errors for invalid percent-encoded sequences.
  • Refactored error handling in z_ubf.erl for decode/2 and encode/3 to use try ... catch, capturing both error reasons and stacktraces for improved debugging. [1] [2]

Testing improvements:

  • Added new tests in z_convert_test.erl for invalid timezone conversions and in z_ubf_test.erl for decode/encode error cases, including assertions for error types and stacktraces. [1] [2]
  • Included a test for handling invalid percent-encoded input in z_html:noscript/1.

CI and dependency updates:

  • Updated the GitHub Actions workflow in .github/workflows/test.yml to test against newer OTP versions (27, 28, 29) and upgraded the actions/checkout version to v7 for improved CI reliability.

@mworrell
mworrell merged commit 7e6ef4a into master Sep 20, 2026
3 checks passed
@mworrell
mworrell deleted the otp29 branch September 20, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant