maybe you could refactor this introducing a base "ProviderException" and except it rather than by name?