SocketStreams v1.11.1
Loading...
Searching...
No Matches
WebException.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <stdexcept>
5
6namespace web
7{
8 namespace exceptions
9 {
11 class WebException : public std::runtime_error
12 {
13 protected:
14 std::string data;
15 std::string_view file;
17 int line;
18
19 private:
21
22 public:
23 WebException(int line, std::string_view file);
24
25 WebException(const WebException& other) = default;
26
27 WebException(WebException&& other) noexcept = default;
28
29 WebException& operator = (const WebException& other) = default;
30
31 WebException& operator = (WebException&& other) noexcept = default;
32
33 const char* what() const noexcept override;
34
35 int getErrorCode() const noexcept;
36
37 int getLine() const noexcept;
38
39 std::string_view getFile() const noexcept;
40
41 virtual ~WebException() = default;
42 };
43 }
44}
45
46#define THROW_WEB_EXCEPTION { throw web::exceptions::WebException(__LINE__, __FILE__); }
Network exception.
Definition WebException.h:12
WebException(WebException &&other) noexcept=default
WebException & operator=(const WebException &other)=default
int errorCode
Definition WebException.h:16
int getLine() const noexcept
Definition WebException.cpp:312
std::string data
Definition WebException.h:14
std::string_view getFile() const noexcept
Definition WebException.cpp:317
int getErrorCode() const noexcept
Definition WebException.cpp:307
const char * what() const noexcept override
Definition WebException.cpp:302
int line
Definition WebException.h:17
std::string_view file
Definition WebException.h:15
WebException(const WebException &other)=default
Definition ContainerWrapper.cpp:4