SQL & CreateFolder errors not handled with On Error [#6709]

Beta Testing for Windows Products and plugins

Moderator: Gurus

ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

SQL & CreateFolder errors not handled with On Error [#6709]

Post by ZvezdanD »

I posted this one year ago, but without any response from MM developers. It is really annoying. I am (we are) getting those ugly error messages saying that SQL has some error, even if I put On Error Resume Next in the front of the OpenSQL.
Image

If I remove On Error Resume Next I am getting one more error message displayed for each error.
Image

Here is one more example of some API method which cannot be handled:

Code: Select all

    On Error Resume Next
    SDB.Tools.FileSystem.CreateFolder "C:\Temp\P5 ...\Test\"
Image

Please MM developers, could you tell me if those messages cannot be handled for some technical reason?
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
jiri
Posts: 5430
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Re: OpenSQL & CreateFolder errors are not handled with On Error

Post by jiri »

Well, yes, these error messages are handled directly by MM, i.e. a dialog showing the error and giving user chance to choose how to continue is there, so On Error doesn't have any effect on this. The only possible solution would be to instruct MM by script how to handle given errors. I.e. some interface like DoOnSQLError = seCancel.

Jiri
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: OpenSQL & CreateFolder errors are not handled with On Error

Post by ZvezdanD »

jiri wrote:Well, yes, these error messages are handled directly by MM, i.e. a dialog showing the error and giving user chance to choose how to continue is there, so On Error doesn't have any effect on this.
Well, I could understand such behavior in case of the CreateFolder method, but what is a point of duplicated error messages with OpenSQL?
jiri wrote:The only possible solution would be to instruct MM by script how to handle given errors. I.e. some interface like DoOnSQLError = seCancel.
Yes, I though about exactly same thing. Also, DoOnFileSysError property. And one more thing which is not (cannot be) handled with scripts - moving files related to some audio files which is reported here.

After oSongData.Path = "..." if you have some additional files beside of audio files in the same folder, e.g. album arts or even .html files or anything else, MM displays dialog box asking if you want to move such files together with audio files when the folder is emptied. This is nice, but it displays such dialog after each emptied folder, and if you have selected bunch of files from several folders (i.e. if oSongData.Path is inside of some loop) you would get same dialog box several times which could be really tedious.

Well, it seems that you already changed this. I just tested 1252 and mentioned dialog box doesn't appear anymore, so all related files (jpg, ...) stay in same old folders even if all audio files are moved to another folder. So, maybe you should return back that dialog box with added some new property like DoOnMoveRelatedFiles = seYes (seYesToAll, seNo).
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
jiri
Posts: 5430
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Re: OpenSQL & CreateFolder errors are not handled with On Error

Post by jiri »

Well, I could understand such behavior in case of the CreateFolder method, but what is a point of duplicated error messages with OpenSQL?
That's correctly propagated exception. The first error is always shown and then, if user presses Cancel, the exception continue to be propagated and has to be handled by scripting handler.
Yes, I though about exactly same thing. Also, DoOnFileSysError property.
Feel free to mail me a list of such necessary properties, so that it can get into Mantis and can be implemented in the next version.

Jiri
Lowlander
Posts: 58741
Joined: Sat Sep 06, 2003 5:53 pm

Re: OpenSQL & CreateFolder errors are not handled with On Er

Post by Lowlander »

This should be fixed, can you confirm: http://www.ventismedia.com/mantis/view.php?id=6709
Post Reply