Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Алина Орехова
laba_1
Commits
fea0dbba
Commit
fea0dbba
authored
4 years ago
by
Алина Орехова
Browse files
Options
Download
Patches
Plain Diff
Add new file
parent
d78b4385
master
No related merge requests found
Pipeline
#658
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exception.h
+37
-0
exception.h
with
37 additions
and
0 deletions
+37
-0
exception.h
0 → 100644
+
37
−
0
View file @
fea0dbba
#ifndef LABORATORY_WORK_1_2_EXCEPTIONS_H
#define LABORATORY_WORK_1_2_EXCEPTIONS_H
#include
<exception>
#include
<string>
class
BadFileFormatException
:
public
std
::
exception
{
std
::
string
error
;
public:
BadFileFormatException
()
{
error
.
assign
(
"Unknown or unsupported file format!"
);
}
explicit
BadFileFormatException
(
const
std
::
string
&
file_format
)
{
error
.
assign
(
"File format
\"
"
+
file_format
+
"
\"
is not supported!"
);
}
const
char
*
what
()
const
noexcept
override
{
return
error
.
c_str
();
}
};
class
NoFileFoundException
:
public
std
::
exception
{
std
::
string
error
;
public:
NoFileFoundException
()
{
error
.
assign
(
"Cannot open file! Probably it does not exist!"
);
}
explicit
NoFileFoundException
(
const
std
::
string
&
file_
)
{
error
.
assign
(
"Cannot open file:
\"
"
+
file_
+
"
\"
! Probably it does not exist!"
);
}
const
char
*
what
()
const
noexcept
override
{
return
error
.
c_str
();
}
};
#endif
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Explore
Projects
Groups
Topics
Snippets