Page MenuHomePhabricator

Provide some "preg_*" wrappers which raise exceptions on failure
ClosedPublic

Authored by epriestley on Feb 17 2021, 8:44 PM.
Tags
None
Referenced Files
F19063365: D21561.id.diff
Sat, Nov 29, 6:20 PM
F19052802: D21561.diff
Fri, Nov 28, 5:56 AM
F19014292: D21561.id51348.diff
Nov 22 2025, 7:30 PM
F18988131: D21561.diff
Nov 18 2025, 12:47 AM
F18914281: D21561.diff
Nov 9 2025, 6:46 AM
F18839682: D21561.id.diff
Oct 27 2025, 6:13 PM
F18833846: D21561.diff
Oct 26 2025, 6:05 AM
F18787532: D21561.id51348.diff
Oct 15 2025, 12:11 AM
Subscribers
None

Details

Summary

Ref T13608. Ref T13100. Ref T13586. Properly checking "preg_match()" and similar calls for failure and raising useful exceptions is complicated and error-prone. Provide wrapper functions with an API that's more consistent with the rest of the codebase: matches are returned; and errors raise detailed exceptions.

Test Plan

See next change.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable