File: SystemCallException.cpp

package info (click to toggle)
xrdp 0.10.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 15,088 kB
  • sloc: ansic: 107,426; sh: 5,852; asm: 4,742; cpp: 2,555; makefile: 1,474
file content (33 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Created by cheesekun on 2/28/22.
//

#include <cstring>
#include <sstream>

#include "SystemCallException.hpp"

SystemCallException::SystemCallException(int _errno, std::string funcName):
        _errno(_errno),
        _message(strerror(errno)),
        _funcName(funcName),
        _what()
{
    std::stringstream sstream;
    sstream << _funcName << "(): "
            << _message << " (" << _errno << ")";

    _what = sstream.str();
}

int SystemCallException::getErrno() const {
    return _errno;
}

const std::string &SystemCallException::getMessage() const {
    return _message;
}

const char *SystemCallException::what() const noexcept {
    return _what.c_str();
}