Skip to content

Commit

Permalink
fix: Give an explicit message when the server respond with an error #317
Browse files Browse the repository at this point in the history
 (#334)

* fix empty API url

* fix: Give an explicit message when the server respond with an error #317

* update release.md
  • Loading branch information
simulot authored Jun 29, 2024
1 parent efcc908 commit bb25711
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (app *SharedFlags) InitSharedFlags() {
func (app *SharedFlags) SetFlags(fs *flag.FlagSet) {
fs.StringVar(&app.ConfigurationFile, "use-configuration", app.ConfigurationFile, "Specifies the configuration to use")
fs.StringVar(&app.Server, "server", app.Server, "Immich server address (http://<your-ip>:2283 or https://<your-domain>)")
fs.StringVar(&app.API, "api", "", "Immich api endpoint (http://container_ip:3301)")
fs.StringVar(&app.API, "api", app.API, "Immich api endpoint (http://container_ip:3301)")
fs.StringVar(&app.Key, "key", app.Key, "API Key")
fs.StringVar(&app.DeviceUUID, "device-uuid", app.DeviceUUID, "Set a device UUID")
fs.StringVar(&app.LogLevel, "log-level", app.LogLevel, "Log level (DEBUG|INFO|WARN|ERROR), default INFO")
Expand Down
7 changes: 7 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release notes

### fix: [#317](https://github.com/simulot/immich-go/issues/317)
When the server doesn't reply as expected, the message is now explicit:
```
the ping API end point doesn't respond at this address: http://localhost:2283/api/server-info/ping
```


### feat: Server's activity graph
The UI mode now show the current activity of the immich server. After 10 seconds of zero activity, the program stops

Expand Down
2 changes: 1 addition & 1 deletion immich/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (ic *ImmichClient) PingServer(ctx context.Context) error {
r := PingResponse{}
err := ic.newServerCall(ctx, "PingServer").do(get("/server-info/ping", setAcceptJSON()), responseJSON(&r))
if err != nil {
return err
return fmt.Errorf("the ping API end point doesn't respond at this address: %s", ic.endPoint+"/server-info/ping")
}
if r.Res != "pong" {
return fmt.Errorf("incorrect ping response: %s", r.Res)
Expand Down

0 comments on commit bb25711

Please sign in to comment.