Formats a phone number to the specified format, throwing an error if formatting fails.
This is a convenience function that wraps formatPhoneNumber and throws an error
instead of returning a ServiceResult. Use this when you want to handle errors via
exception handling rather than explicit error checking.
Formats a phone number to the specified format, throwing an error if formatting fails.
This is a convenience function that wraps
formatPhoneNumberand throws an error instead of returning a ServiceResult. Use this when you want to handle errors via exception handling rather than explicit error checking.