v1/files/move fails to throw error when file to be moved is locked

Started by ubacher, April 07, 2019, 01:55:09 PM

Previous topic - Next topic

ubacher

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:
  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

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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook


Mario

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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook