Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Adds logger / Removes raise exception when unknown territory #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guiferrpereira
Copy link

@guiferrpereira guiferrpereira commented Sep 22, 2017

So there are some countries that aren't on Database, but they exist: https://github.com/googlei18n/libphonenumber/issues/76

IMHO raising an exception it's not the best solution when we have an invalid territory.

So my suggestion is to log it as a warning, but return nil.

GlobalPhone.parse("+93 1289312", "PN")

ArgumentError: unknown territory `PN'

VS

GlobalPhone.parse("+93 1289312", "PN")

nil

Removes raise exception when unknown territory
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant