Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取文件信息与文档描述不符 #19

Open
chouney opened this issue May 9, 2018 · 1 comment
Open

获取文件信息与文档描述不符 #19

chouney opened this issue May 9, 2018 · 1 comment

Comments

@chouney
Copy link

chouney commented May 9, 2018

api:获取文件信息,上面说的是当指定文件不存在时返回null。但是实际上当不存在时会抛出异常:

Caused by: java.io.FileNotFoundException: http://v0.api.upyun.com/xxxxxx/path/to/file
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at main.java.com.UpYun.getText(UpYun.java:906)

因为上传文件会存在覆盖问题,因此需要使用该api来进行文件判定(文档上面是这样写的)。
个人感觉在业务逻辑当中通过异常来进行判断不太优雅,可能使得业务逻辑的异常和真正出现的异常相混淆而出错。建议修复此问题

@ghost
Copy link

ghost commented Dec 16, 2019

我也遇到了同样的问题,有什么解决方法吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant