geocoder-php / geocoder-php/Geocoder

Chain Provider catch Exception

未关闭
#881 7 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

question
主要语言
PHP
星标
4k
派生
525
平均合并
8 分钟
30 天内合并 PR
1

描述

Hi,

Currently, the chain provider only logs the exceptions, there is no way to catch the exceptions and we always get an empty AddressCollection in case something went wrong. There is no way to know if the collection is empty because there were no results or if an error occurred.

A simple customized solution would be to extend the class Chain and throw the exception but it's not possible since it's final. All I can do is to replicate the class (not best solution).

If there is a workaround about this I would like to hear about it, otherwise I guess it must be implemented a way to catch the erros.

Thank you.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读最终的 Chain 类及其 provider 执行路径,以了解当前异常在哪里被记录并转换为空的 AddressCollection。检查附近关于 Chain provider 行为的测试,然后将完成标准定义为:向调用方提供一种可靠的方式来区分无结果和 provider 错误,并通过测试覆盖该行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。