CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
web_exception.h
1
2#pragma once
3
4#include <system/exceptions.h>
5#include <system/shared_ptr.h>
6#include <system/string.h>
7
8#include <net/http_web_request.h>
9#include <net/web_exception_status.h>
10
11namespace System { namespace Net {
12
13class Details_WebException;
15
20{
21 friend class System::ExceptionWrapperHelper;
22 template <typename T> friend class System::ExceptionWrapper;
24
25public:
28
31 ASPOSECPP_SHARED_API WebExceptionStatus get_Status();
35
37 ASPOSECPP_SHARED_API Details_WebException();
38 MEMBER_FUNCTION_MAKE_OBJECT(Details_WebException, CODEPORTING_ARGS(), CODEPORTING_ARGS());
41 ASPOSECPP_SHARED_API Details_WebException(String message);
42 MEMBER_FUNCTION_MAKE_OBJECT(Details_WebException, CODEPORTING_ARGS(String message), CODEPORTING_ARGS(message));
46 ASPOSECPP_SHARED_API Details_WebException(String message, Exception innerException);
47 MEMBER_FUNCTION_MAKE_OBJECT(Details_WebException, CODEPORTING_ARGS(String message, Exception innerException), CODEPORTING_ARGS(message, innerException));
51 ASPOSECPP_SHARED_API Details_WebException(String message, WebExceptionStatus status);
52 MEMBER_FUNCTION_MAKE_OBJECT(Details_WebException, CODEPORTING_ARGS(String message, WebExceptionStatus status), CODEPORTING_ARGS(message, status));
58 ASPOSECPP_SHARED_API Details_WebException(String message, Exception innerException, WebExceptionStatus status,
60 MEMBER_FUNCTION_MAKE_OBJECT(Details_WebException,
61 CODEPORTING_ARGS(
62 String message, Exception innerException, WebExceptionStatus status,
64 ),
65 CODEPORTING_ARGS(message, innerException, status, response)
66 );
67
71
72protected:
74 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_WebException>(self); }
75
76private:
78 static const WebExceptionStatus DefaultStatus;
80 WebExceptionStatus _status;
83};
84
85}} // namespace System::Net
The exception that is thrown when a method is invoked on an object which is in the state inconsistent...
Template that represents wrapper of exceptions that are derived from Exception class.
Definition: exception.h:113
Represents the exception that is thrown by WebRequest when an error occurs. Never create instances of...
Definition: web_exception.h:20
Details_WebException(String message, Exception innerException, WebExceptionStatus status, System::SharedPtr< WebResponse > response)
Constructs a new instance.
Details_WebException(String message, WebExceptionStatus status)
Constructs a new instance.
virtual ~Details_WebException()
Destructs the current instance.
System::SharedPtr< WebResponse > get_Response()
Returns the web response with which the current exception is associated.
Details_WebException(String message)
Constructs a new instance.
Details_WebException()
Constructs a new instance.
void DoThrow(const System::ExceptionPtr &self) const override
Throws exception instance wrapped by exception wrapper.
Definition: web_exception.h:74
static Exception CreateCompatibleException(Exception exception)
Is not implemented.
Details_WebException(String message, Exception innerException)
Constructs a new instance.
WebExceptionStatus get_Status()
Returns the status code.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
WebExceptionStatus
Enumerates the status codes of the WebException class.
Definition: web_exception_status.h:8
Definition: db_command.h:9