Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
6752e25b
"docs/source/vscode:/vscode.git/clone" did not exist on "6ba2231d7227825dfb76e9df161824d04234e69f"
Commit
6752e25b
authored
Jul 10, 2009
by
jbeder
Browse files
(Finally) overrode Exception::what()\n
parent
ae89793c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
include/exceptions.h
include/exceptions.h
+6
-0
util/parse.cpp
util/parse.cpp
+1
-1
No files found.
include/exceptions.h
View file @
6752e25b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include <exception>
#include <exception>
#include <string>
#include <string>
#include <sstream>
namespace
YAML
namespace
YAML
{
{
...
@@ -62,6 +63,11 @@ namespace YAML
...
@@ -62,6 +63,11 @@ namespace YAML
Exception
(
int
line_
,
int
column_
,
const
std
::
string
&
msg_
)
Exception
(
int
line_
,
int
column_
,
const
std
::
string
&
msg_
)
:
line
(
line_
),
column
(
column_
),
msg
(
msg_
)
{}
:
line
(
line_
),
column
(
column_
),
msg
(
msg_
)
{}
virtual
~
Exception
()
throw
()
{}
virtual
~
Exception
()
throw
()
{}
virtual
const
char
*
what
()
const
throw
()
{
std
::
stringstream
output
;
output
<<
"Error at line "
<<
line
+
1
<<
", column "
<<
column
+
1
<<
": "
<<
msg
;
return
output
.
str
().
c_str
();
}
int
line
,
column
;
int
line
,
column
;
std
::
string
msg
;
std
::
string
msg
;
...
...
util/parse.cpp
View file @
6752e25b
...
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
...
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
YAML
::
Node
doc
;
YAML
::
Node
doc
;
parser
.
GetNextDocument
(
doc
);
parser
.
GetNextDocument
(
doc
);
}
catch
(
const
YAML
::
Exception
&
e
)
{
}
catch
(
const
YAML
::
Exception
&
e
)
{
std
::
cerr
<<
"Error at line "
<<
e
.
line
<<
", col "
<<
e
.
column
<<
": "
<<
e
.
msg
<<
"
\n
"
;
std
::
cerr
<<
e
.
what
()
<<
"
\n
"
;
}
}
return
0
;
return
0
;
}
}
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