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
741c6f11
Commit
741c6f11
authored
Nov 10, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: remove the obsolete Error support code
parent
43b285ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
42 deletions
+1
-42
AllCommands.cxx
src/command/AllCommands.cxx
+0
-5
CommandError.cxx
src/command/CommandError.cxx
+0
-29
CommandError.hxx
src/command/CommandError.hxx
+1
-5
PlayerCommands.cxx
src/command/PlayerCommands.cxx
+0
-3
No files found.
src/command/AllCommands.cxx
View file @
741c6f11
...
...
@@ -39,7 +39,6 @@
#include "client/Response.hxx"
#include "util/Macros.hxx"
#include "util/Tokenizer.hxx"
#include "util/Error.hxx"
#include "util/StringAPI.hxx"
#ifdef ENABLE_SQLITE
...
...
@@ -418,8 +417,4 @@ try {
Response
r
(
client
,
num
);
PrintError
(
r
,
std
::
current_exception
());
return
CommandResult
::
ERROR
;
}
catch
(
const
Error
&
error
)
{
Response
r
(
client
,
num
);
print_error
(
r
,
error
);
return
CommandResult
::
ERROR
;
}
src/command/CommandError.cxx
View file @
741c6f11
...
...
@@ -22,7 +22,6 @@
#include "PlaylistError.hxx"
#include "db/DatabaseError.hxx"
#include "client/Response.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
#include <system_error>
...
...
@@ -84,30 +83,6 @@ ToAck(DatabaseErrorCode code)
gcc_pure
static
enum
ack
ToAck
(
const
Error
&
error
)
{
if
(
error
.
IsDomain
(
ack_domain
))
{
return
(
enum
ack
)
error
.
GetCode
();
}
else
if
(
error
.
IsDomain
(
errno_domain
))
{
return
ACK_ERROR_SYSTEM
;
}
return
ACK_ERROR_UNKNOWN
;
}
CommandResult
print_error
(
Response
&
r
,
const
Error
&
error
)
{
assert
(
error
.
IsDefined
());
LogError
(
error
);
r
.
Error
(
ToAck
(
error
),
error
.
GetMessage
());
return
CommandResult
::
ERROR
;
}
gcc_pure
static
enum
ack
ToAck
(
std
::
exception_ptr
ep
)
{
try
{
...
...
@@ -125,8 +100,6 @@ ToAck(std::exception_ptr ep)
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20151204
}
catch
(
const
std
::
exception
&
e
)
{
#else
}
catch
(
const
Error
&
error
)
{
return
ToAck
(
error
);
}
catch
(...)
{
#endif
try
{
...
...
@@ -152,8 +125,6 @@ PrintError(Response &r, std::exception_ptr ep)
}
catch
(
const
std
::
exception
&
e
)
{
LogError
(
e
);
r
.
Error
(
ToAck
(
ep
),
e
.
what
());
}
catch
(
const
Error
&
error
)
{
print_error
(
r
,
error
);
}
catch
(...)
{
r
.
Error
(
ACK_ERROR_UNKNOWN
,
"Unknown error"
);
}
...
...
src/command/CommandError.hxx
View file @
741c6f11
...
...
@@ -25,14 +25,10 @@
#include <exception>
class
Response
;
class
Error
;
/**
* Send the
#Error
to the client.
* Send the
exception
to the client.
*/
CommandResult
print_error
(
Response
&
r
,
const
Error
&
error
);
void
PrintError
(
Response
&
r
,
std
::
exception_ptr
ep
);
...
...
src/command/PlayerCommands.cxx
View file @
741c6f11
...
...
@@ -32,7 +32,6 @@
#include "AudioFormat.hxx"
#include "ReplayGainConfig.hxx"
#include "util/ScopeExit.hxx"
#include "util/Error.hxx"
#ifdef ENABLE_DATABASE
#include "db/update/Service.hxx"
...
...
@@ -196,8 +195,6 @@ handle_status(Client &client, gcc_unused Request args, Response &r)
client
.
player_control
.
LockCheckRethrowError
();
}
catch
(
const
std
::
exception
&
e
)
{
r
.
Format
(
COMMAND_STATUS_ERROR
": %s
\n
"
,
e
.
what
());
}
catch
(
const
Error
&
error
)
{
r
.
Format
(
COMMAND_STATUS_ERROR
": %s
\n
"
,
error
.
GetMessage
());
}
catch
(...)
{
r
.
Format
(
COMMAND_STATUS_ERROR
": unknown
\n
"
);
}
...
...
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