Skip to content

Commit 6697b2c

Browse files
committed
fix: improve error messages in PingServer for better debugging
1 parent 7982ddb commit 6697b2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

immich/ping.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ func (ic *ImmichClient) PingServer(ctx context.Context) error {
1818
b := bytes.NewBuffer(nil)
1919
err := ic.newServerCall(ctx, EndPointPingServer).do(getRequest("/server/ping", setAcceptJSON()), responseCopy(b), responseJSON(&r))
2020
if err != nil {
21-
return fmt.Errorf("unexpected response to the immich's ping API at this address: %s:\n%s", ic.endPoint+"/server/ping", b.String())
21+
return fmt.Errorf("error while calling the immich's ping API at this address: %s:\n%s", ic.endPoint+"/server/ping", err.Error())
2222
}
2323
if r.Res != "pong" {
24-
return fmt.Errorf("incorrect ping response: %s", r.Res)
24+
return fmt.Errorf("unexpected response to the immich's ping API at this address: %s:\n%s", ic.endPoint+"/server/ping", b.String())
2525
}
2626
return nil
2727
}

0 commit comments

Comments
 (0)