Author Topic: v1/files/move fails to throw error when file to be moved is locked  (Read 177 times)

ubacher

  • Super Hero
  • ****
  • Posts: 1999
I am moving files to a folder via script. Today one file was not moved. It happened to be still open in
ACR (Photoshop camera raw). The script did not throw an error!
Here is the code I use:
Code: [Select]
  async function moveFiles(files, folderName) {
            var ids = '';
            for (var mm = 0; mm < files.length; mm++) {
                ids = ids + files[mm].id + ','
            }
            try {
                await IMWS.post('v1/files/move', {
                    id: ids,
                    target: folderName,
                    replace: 'makeunique'
                })
                {
                    console.log('done, # moved files:' + files.length)
                    return true
                }
            }
            catch (error) {
                alert('move files error')
                return false
            }
        };  //end of MoveFiles

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 22281
Re: v1/files/move fails to throw error when file to be moved is locked
« Reply #1 on: April 07, 2019, 02:24:19 PM »
What did IMWS return? Did you check the Network tab in your browser?
Your exception handler will only be called when IMatch returns something other than 200 OK.

IMWS should receive an error message from Windows and promote that to the client.

ubacher

  • Super Hero
  • ****
  • Posts: 1999
Re: v1/files/move fails to throw error when file to be moved is locked
« Reply #2 on: April 07, 2019, 03:01:00 PM »
IMWS returns 200!


Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 22281
Re: v1/files/move fails to throw error when file to be moved is locked
« Reply #3 on: April 07, 2019, 03:24:08 PM »
Then the operation succeeded or Windows did not return an error message to IMatch.
I shall investigate this at some later time.
Open a bug report so I can schedule a time slot.