Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
83bbfa4d
There was an error fetching the commit references. Please try again later.
Commit
83bbfa4d
authored
14 years ago
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
add a WcclError exception class
parent
3a20e3be
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libwccl/CMakeLists.txt
+1
-0
1 addition, 0 deletions
libwccl/CMakeLists.txt
libwccl/exception.cpp
+43
-0
43 additions, 0 deletions
libwccl/exception.cpp
libwccl/exception.h
+43
-0
43 additions, 0 deletions
libwccl/exception.h
with
87 additions
and
0 deletions
libwccl/CMakeLists.txt
+
1
−
0
View file @
83bbfa4d
...
@@ -12,6 +12,7 @@ set(LIBS ${LIBS} ${Boost_LIBRARIES})
...
@@ -12,6 +12,7 @@ set(LIBS ${LIBS} ${Boost_LIBRARIES})
SET
(
libwccl_STAT_SRC
SET
(
libwccl_STAT_SRC
bool.cpp
bool.cpp
exception.cpp
main.cpp
main.cpp
position.cpp
position.cpp
sentencecontext.cpp
sentencecontext.cpp
...
...
This diff is collapsed.
Click to expand it.
libwccl/exception.cpp
0 → 100644
+
43
−
0
View file @
83bbfa4d
#include
<libwccl/exception.h>
#include
<sstream>
namespace
Wccl
{
WcclError
::
WcclError
(
const
std
::
string
&
what
)
:
PwrNlp
::
PwrNlpError
(
what
)
{
}
WcclError
::~
WcclError
()
throw
()
{
}
std
::
string
WcclError
::
scope
()
const
{
return
"Wccl"
;
}
FileNotFound
::
FileNotFound
(
const
std
::
string
&
filename
,
const
std
::
string
&
paths
,
const
std
::
string
&
where
)
:
WcclError
(
"File not found: "
+
filename
),
filename
(
filename
),
paths
(
paths
),
where
(
where
)
{
}
FileNotFound
::~
FileNotFound
()
throw
()
{
}
std
::
string
FileNotFound
::
info
()
const
{
std
::
ostringstream
ss
;
if
(
where
.
empty
())
{
ss
<<
"File "
;
}
else
{
ss
<<
where
<<
" file "
;
}
ss
<<
"'"
<<
filename
<<
"' not found in search path "
<<
paths
;
return
ss
.
str
();
}
}
/* end ns Wccl */
This diff is collapsed.
Click to expand it.
libwccl/exception.h
0 → 100644
+
43
−
0
View file @
83bbfa4d
#ifndef LIBWCCL_EXCEPTION_H
#define LIBWCCL_EXCEPTION_H
#include
<libpwrutils/exception.h>
namespace
Wccl
{
/**
* Base class for all Wccl errorss. Derives from
* @c std::runtime_error. Call member function @c what to get a
* human-readable message associated with the error.
*/
class
WcclError
:
public
PwrNlp
::
PwrNlpError
{
public:
/**
* Instantiate a WcclError instance with the given message.
* @param what The message to associate with this error.
*/
WcclError
(
const
std
::
string
&
what
);
~
WcclError
()
throw
();
/// PwrNlpError override
std
::
string
scope
()
const
;
};
class
FileNotFound
:
public
WcclError
{
public:
FileNotFound
(
const
std
::
string
&
filename
,
const
std
::
string
&
paths
,
const
std
::
string
&
where
);
~
FileNotFound
()
throw
();
std
::
string
info
()
const
;
std
::
string
filename
,
paths
,
where
;
};
}
/* end ns Wccl */
#endif // LIBWCCL_EXCEPTION_H
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment