From 6d9dc62a08dd1ee9efa9309eea71dba8f7a94b0c Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 2 Jan 2009 23:16:37 +0000 Subject: capture failure of file/dir access. Courtesy to Filipe Cabecinhas. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1545 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/USongs.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/base/USongs.pas b/src/base/USongs.pas index 6f66bf3f..7f5125a9 100644 --- a/src/base/USongs.pas +++ b/src/base/USongs.pas @@ -275,7 +275,11 @@ var lSong : TSong; begin - Files := Platform.DirectoryFindFiles( Dir, '.txt', true); + try + Files := Platform.DirectoryFindFiles( Dir, '.txt', true) + except + Log.LogError('Couldn''t deal with directory/file: ' + Dir + ' in TSongs.BrowseTXTFiles') + end; for i := 0 to Length(Files)-1 do begin @@ -308,7 +312,11 @@ var lSong : TSong; begin - Files := Platform.DirectoryFindFiles( Dir, '.xml', true); + try + Files := Platform.DirectoryFindFiles( Dir, '.xml', true) + except + Log.LogError('Couldn''t deal with directory/file: ' + Dir + ' in TSongs.BrowseXMLFiles') + end; for i := 0 to Length(Files)-1 do begin -- cgit v1.2.3