-
Notifications
You must be signed in to change notification settings - Fork 7
/
SystemError.h
40 lines (28 loc) · 1.53 KB
/
SystemError.h
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
34
35
36
37
38
39
40
#pragma once
#include "SourceLocation.h"
#include <exception>
#include <string>
namespace Linter
{
class SystemError : public std::exception
{
public:
/** Creates an exception object from the current system error */
explicit SystemError(const SourceLocationCurrent &location = SourceLocation::current());
/** Creates an exception object from the current system error, appends string */
explicit SystemError(std::string const &, const SourceLocationCurrent &location = SourceLocation::current());
/** Creates an exception object given a system error number */
explicit SystemError(DWORD err, const SourceLocationCurrent &location = SourceLocation::current());
/** Creates an exception object from specified error with addition information string */
SystemError(DWORD err, std::string const &, const SourceLocationCurrent &location = SourceLocation::current());
/** Creates an exception object given an HRESULT */
explicit SystemError(HRESULT err, const SourceLocationCurrent &location = SourceLocation::current());
/** Creates an exception object from specified error with addition information string */
SystemError(HRESULT err, std::string const &, const SourceLocationCurrent &location = SourceLocation::current());
~SystemError();
char const *what() const noexcept override;
private:
char m_buff[2048];
void addLocationToMessage(const SourceLocationCurrent &location);
};
} // namespace Linter