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
57808d1a
Commit
57808d1a
authored
Sep 05, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
queue/Save: queue_load_song() throws on error
Don't catch and log exceptions here; let the caller decide.
parent
77756919
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
QueueSave.cxx
src/queue/QueueSave.cxx
+3
-11
QueueSave.hxx
src/queue/QueueSave.hxx
+2
-0
No files found.
src/queue/QueueSave.cxx
View file @
57808d1a
...
...
@@ -95,20 +95,12 @@ queue_load_song(TextFile &file, const SongLoader &loader,
if
((
p
=
StringAfterPrefix
(
line
,
SONG_BEGIN
)))
{
const
char
*
uri
=
p
;
try
{
song
=
song_load
(
file
,
uri
);
}
catch
(...)
{
LogError
(
std
::
current_exception
());
return
;
}
song
=
song_load
(
file
,
uri
);
}
else
{
char
*
endptr
;
long
ret
=
strtol
(
line
,
&
endptr
,
10
);
if
(
ret
<
0
||
*
endptr
!=
':'
||
endptr
[
1
]
==
0
)
{
LogError
(
playlist_domain
,
"Malformed playlist line in state file"
);
return
;
}
if
(
ret
<
0
||
*
endptr
!=
':'
||
endptr
[
1
]
==
0
)
throw
std
::
runtime_error
(
"Malformed playlist line in state file"
);
const
char
*
uri
=
endptr
+
1
;
...
...
src/queue/QueueSave.hxx
View file @
57808d1a
...
...
@@ -35,6 +35,8 @@ queue_save(BufferedOutputStream &os, const Queue &queue);
/**
* Loads one song from the state file and appends it to the queue.
*
* Throws on error.
*/
void
queue_load_song
(
TextFile
&
file
,
const
SongLoader
&
loader
,
...
...
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