seansfkelley / nas-download-manager

An open source browser extension for adding/managing download tasks to your Synology DiskStation.
257 stars 46 forks source link

sometimes reports incorrect error description #183

Closed seansfkelley closed 3 years ago

seansfkelley commented 3 years ago

repro:

  1. log in with a user
  2. change the user's password in DSM
  3. try to load tasks

The error message generated will be "File upload failed.", which is code 400 from the DownloadStation.Task error namespace.

The actual error should be about the invalid password, which is code 400 from the Auth namespace.

This is because SynologyClient obscures the need to log in, but forwards error messages from authentication failures through non-authentication calls.

Possible fixes:

  1. error messages are inlined into the error object
  2. error namespaces are included alongside the code in the error object
  3. error namespaces are normalized to be <foo>.API_NAME and the API name is included in the error object