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
4b79f004
Commit
4b79f004
authored
Feb 07, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/DatabaseError: add exception class DatabaseError
parent
6a789b66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
CommandError.cxx
src/command/CommandError.cxx
+4
-0
DatabaseError.hxx
src/db/DatabaseError.hxx
+14
-0
No files found.
src/command/CommandError.cxx
View file @
4b79f004
...
...
@@ -179,6 +179,10 @@ ToAck(std::exception_ptr ep)
return
pe
.
GetCode
();
}
catch
(
const
PlaylistError
&
pe
)
{
return
ToAck
(
pe
.
GetCode
());
#ifdef ENABLE_DATABASE
}
catch
(
const
DatabaseError
&
de
)
{
return
ToAck
(
de
.
GetCode
());
#endif
}
catch
(
const
std
::
system_error
&
e
)
{
return
ACK_ERROR_SYSTEM
;
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20151204
...
...
src/db/DatabaseError.hxx
View file @
4b79f004
...
...
@@ -20,6 +20,8 @@
#ifndef MPD_DB_ERROR_HXX
#define MPD_DB_ERROR_HXX
#include <stdexcept>
class
Domain
;
enum
class
DatabaseErrorCode
{
...
...
@@ -34,6 +36,18 @@ enum class DatabaseErrorCode {
CONFLICT
,
};
class
DatabaseError
final
:
public
std
::
runtime_error
{
DatabaseErrorCode
code
;
public
:
DatabaseError
(
DatabaseErrorCode
_code
,
const
char
*
msg
)
:
std
::
runtime_error
(
msg
),
code
(
_code
)
{}
DatabaseErrorCode
GetCode
()
const
{
return
code
;
}
};
extern
const
Domain
db_domain
;
#endif
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