Page MenuHomePhabricator

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

Authored by epriestley on Wed, Feb 17, 8:44 PM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.