Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
f76544be
Commit
f76544be
authored
Oct 29, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/update: catch all exceptions
parent
1e6c4453
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
21 deletions
+21
-21
Archive.cxx
src/db/update/Archive.cxx
+2
-2
Container.cxx
src/db/update/Container.cxx
+2
-2
ExcludeList.cxx
src/db/update/ExcludeList.cxx
+1
-1
InotifyUpdate.cxx
src/db/update/InotifyUpdate.cxx
+8
-8
UpdateIO.cxx
src/db/update/UpdateIO.cxx
+6
-6
Walk.cxx
src/db/update/Walk.cxx
+2
-2
No files found.
src/db/update/Archive.cxx
View file @
f76544be
...
@@ -153,8 +153,8 @@ UpdateWalk::UpdateArchiveFile(Directory &parent, const char *name,
...
@@ -153,8 +153,8 @@ UpdateWalk::UpdateArchiveFile(Directory &parent, const char *name,
ArchiveFile
*
file
;
ArchiveFile
*
file
;
try
{
try
{
file
=
archive_file_open
(
&
plugin
,
path_fs
);
file
=
archive_file_open
(
&
plugin
,
path_fs
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
if
(
directory
!=
nullptr
)
if
(
directory
!=
nullptr
)
editor
.
LockDeleteDirectory
(
directory
);
editor
.
LockDeleteDirectory
(
directory
);
return
;
return
;
...
...
src/db/update/Container.cxx
View file @
f76544be
...
@@ -119,9 +119,9 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
...
@@ -119,9 +119,9 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
modified
=
true
;
modified
=
true
;
}
}
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
editor
.
LockDeleteDirectory
(
contdir
);
editor
.
LockDeleteDirectory
(
contdir
);
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
return
false
;
return
false
;
}
}
...
...
src/db/update/ExcludeList.cxx
View file @
f76544be
...
@@ -78,7 +78,7 @@ ExcludeList::Check(Path name_fs) const noexcept
...
@@ -78,7 +78,7 @@ ExcludeList::Check(Path name_fs) const noexcept
try
{
try
{
if
(
i
.
Check
(
NarrowPath
(
name_fs
).
c_str
()))
if
(
i
.
Check
(
NarrowPath
(
name_fs
).
c_str
()))
return
true
;
return
true
;
}
catch
(
const
std
::
runtime_error
&
)
{
}
catch
(
...
)
{
}
}
}
}
#else
#else
...
...
src/db/update/InotifyUpdate.cxx
View file @
f76544be
...
@@ -187,8 +187,8 @@ recursive_watch_subdirectories(WatchDirectory *directory,
...
@@ -187,8 +187,8 @@ recursive_watch_subdirectories(WatchDirectory *directory,
FileInfo
fi
;
FileInfo
fi
;
try
{
try
{
fi
=
FileInfo
(
child_path_fs
);
fi
=
FileInfo
(
child_path_fs
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
continue
;
continue
;
}
}
...
@@ -198,8 +198,8 @@ recursive_watch_subdirectories(WatchDirectory *directory,
...
@@ -198,8 +198,8 @@ recursive_watch_subdirectories(WatchDirectory *directory,
try
{
try
{
ret
=
inotify_source
->
Add
(
child_path_fs
.
c_str
(),
ret
=
inotify_source
->
Add
(
child_path_fs
.
c_str
(),
IN_MASK
);
IN_MASK
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
FormatError
(
e
,
FormatError
(
std
::
current_exception
()
,
"Failed to register %s"
,
"Failed to register %s"
,
child_path_fs
.
c_str
());
child_path_fs
.
c_str
());
continue
;
continue
;
...
@@ -302,8 +302,8 @@ mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update,
...
@@ -302,8 +302,8 @@ mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update,
inotify_source
=
new
InotifySource
(
loop
,
inotify_source
=
new
InotifySource
(
loop
,
mpd_inotify_callback
,
mpd_inotify_callback
,
nullptr
);
nullptr
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
return
;
return
;
}
}
...
@@ -312,8 +312,8 @@ mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update,
...
@@ -312,8 +312,8 @@ mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update,
int
descriptor
;
int
descriptor
;
try
{
try
{
descriptor
=
inotify_source
->
Add
(
path
.
c_str
(),
IN_MASK
);
descriptor
=
inotify_source
->
Add
(
path
.
c_str
(),
IN_MASK
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
delete
inotify_source
;
delete
inotify_source
;
inotify_source
=
nullptr
;
inotify_source
=
nullptr
;
return
;
return
;
...
...
src/db/update/UpdateIO.cxx
View file @
f76544be
...
@@ -36,8 +36,8 @@ GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info) noexcept
...
@@ -36,8 +36,8 @@ GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info) noexcept
try
{
try
{
info
=
storage
.
GetInfo
(
uri_utf8
,
true
);
info
=
storage
.
GetInfo
(
uri_utf8
,
true
);
return
true
;
return
true
;
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
return
false
;
return
false
;
}
}
...
@@ -46,8 +46,8 @@ GetInfo(StorageDirectoryReader &reader, StorageFileInfo &info) noexcept
...
@@ -46,8 +46,8 @@ GetInfo(StorageDirectoryReader &reader, StorageFileInfo &info) noexcept
try
{
try
{
info
=
reader
.
GetInfo
(
true
);
info
=
reader
.
GetInfo
(
true
);
return
true
;
return
true
;
}
catch
(
const
std
::
runtime_error
&
e
)
{
}
catch
(
...
)
{
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
return
false
;
return
false
;
}
}
...
@@ -58,7 +58,7 @@ DirectoryExists(Storage &storage, const Directory &directory) noexcept
...
@@ -58,7 +58,7 @@ DirectoryExists(Storage &storage, const Directory &directory) noexcept
try
{
try
{
info
=
storage
.
GetInfo
(
directory
.
GetPath
(),
true
);
info
=
storage
.
GetInfo
(
directory
.
GetPath
(),
true
);
}
catch
(
const
std
::
runtime_error
&
)
{
}
catch
(
...
)
{
return
false
;
return
false
;
}
}
...
@@ -83,7 +83,7 @@ directory_child_is_regular(Storage &storage, const Directory &directory,
...
@@ -83,7 +83,7 @@ directory_child_is_regular(Storage &storage, const Directory &directory,
try
{
try
{
return
GetDirectoryChildInfo
(
storage
,
directory
,
name_utf8
)
return
GetDirectoryChildInfo
(
storage
,
directory
,
name_utf8
)
.
IsRegular
();
.
IsRegular
();
}
catch
(
const
std
::
runtime_error
&
)
{
}
catch
(
...
)
{
return
false
;
return
false
;
}
}
...
...
src/db/update/Walk.cxx
View file @
f76544be
...
@@ -244,8 +244,8 @@ try {
...
@@ -244,8 +244,8 @@ try {
FormatDebug
(
update_domain
,
FormatDebug
(
update_domain
,
"%s is not a directory, archive or music"
,
name
);
"%s is not a directory, archive or music"
,
name
);
}
}
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
...
)
{
LogError
(
e
);
LogError
(
std
::
current_exception
()
);
}
}
/* we don't look at "." / ".." nor files with newlines in their name */
/* we don't look at "." / ".." nor files with newlines in their name */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment