happyfish100 / happyfish100/fastdfs-client-java

出现问题不会抛出异常

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.6k
Forks
891
PR merge metrics
No merged PRs in 30d

Description

比如 https://github.com/happyfish100/fastdfs-client-java/blob/master/src/main/java/org/csource/fastdfs/TrackerClient.java#L736
如果,连不到服务器时,异常直接输出到终端,不会抛出,会让用户很困惑,而且正规的项目,是不希望在终端答应 StackTrace,而是输入到对应的日志文件。

try {
        trackerServer = trackerGroup.getConnection(serverIndex);
      } catch (IOException ex) {
        ex.printStackTrace(System.err);
        this.errno = ProtoCommon.ECONNREFUSED;
        return false;
      }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/main/java/org/csource/fastdfs/TrackerClient.java around line 736 and inspect how connection failures are handled when the server cannot be reached. Trace the caller's expected failure behavior and the project's logging conventions. Done means the connection error is propagated appropriately without printing a stack trace directly to the terminal.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.