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
6a789b66
Commit
6a789b66
authored
Feb 07, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/CommandError: move code to ToAck(DatabaseErrorCode)
parent
0d8e44a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
CommandError.cxx
src/command/CommandError.cxx
+19
-8
No files found.
src/command/CommandError.cxx
View file @
6a789b66
...
...
@@ -66,6 +66,24 @@ ToAck(PlaylistResult result)
return
ACK_ERROR_UNKNOWN
;
}
#ifdef ENABLE_DATABASE
gcc_const
static
enum
ack
ToAck
(
DatabaseErrorCode
code
)
{
switch
(
code
)
{
case
DatabaseErrorCode
:
:
DISABLED
:
case
DatabaseErrorCode
:
:
NOT_FOUND
:
return
ACK_ERROR_NO_EXIST
;
case
DatabaseErrorCode
:
:
CONFLICT
:
return
ACK_ERROR_ARG
;
}
return
ACK_ERROR_UNKNOWN
;
}
#endif
CommandResult
print_playlist_result
(
Response
&
r
,
PlaylistResult
result
)
{
...
...
@@ -129,14 +147,7 @@ ToAck(const Error &error)
return
(
enum
ack
)
error
.
GetCode
();
#ifdef ENABLE_DATABASE
}
else
if
(
error
.
IsDomain
(
db_domain
))
{
switch
((
DatabaseErrorCode
)
error
.
GetCode
())
{
case
DatabaseErrorCode
:
:
DISABLED
:
case
DatabaseErrorCode
:
:
NOT_FOUND
:
return
ACK_ERROR_NO_EXIST
;
case
DatabaseErrorCode
:
:
CONFLICT
:
return
ACK_ERROR_ARG
;
}
return
ToAck
((
DatabaseErrorCode
)
error
.
GetCode
());
#endif
}
else
if
(
error
.
IsDomain
(
locate_uri_domain
))
{
return
ACK_ERROR_ARG
;
...
...
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