forked from University/epr24pr5-ojanssen2
33 lines
549 B
C
33 lines
549 B
C
|
#pragma once
|
||
|
#include "std_lib_inc.h"
|
||
|
#include <exception>
|
||
|
#ifndef FILEERROR_H
|
||
|
#define FILEERROR_H
|
||
|
|
||
|
namespace err
|
||
|
{
|
||
|
class Error final : public exception
|
||
|
{
|
||
|
private:
|
||
|
string why;
|
||
|
int return_no;
|
||
|
|
||
|
public:
|
||
|
Error(const int& return_no, const string& msg) : exception(), why(msg), return_no(return_no)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
int get_nr() const
|
||
|
{
|
||
|
return this->return_no;
|
||
|
}
|
||
|
|
||
|
string what()
|
||
|
{
|
||
|
return this->why;
|
||
|
}
|
||
|
};
|
||
|
} // err
|
||
|
|
||
|
#endif // FILEERROR_H
|