1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00

Correções em exception

This commit is contained in:
Danilo Borges Santos 2024-12-04 10:04:51 -03:00
parent 7bc21eec80
commit 75d5dd5011

View File

@ -181,21 +181,14 @@ namespace csharp {
class ArgumentException : public Exception { class ArgumentException : public Exception {
public: public:
ArgumentException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current()) ArgumentException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current())
: Exception(message.value_or(SR::Arg_ArgumentException), source) : ArgumentException(std::nullopt, message, nullptr, source){ }
{
HRresult = HResults::HR_COR_E_ARGUMENT;
};
ArgumentException(OptionalString const& paramName, OptionalString const& message, std::source_location const& source = std::source_location::current()) ArgumentException(OptionalString const& paramName, OptionalString const& message, std::source_location const& source = std::source_location::current())
: paramName(paramName), Exception(message.value_or(SR::Arg_ArgumentException), source) : ArgumentException(paramName, message, nullptr, source) { }
{
HRresult = HResults::HR_COR_E_ARGUMENT;
};
ArgumentException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) ArgumentException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: Exception(message.value_or(SR::Arg_ArgumentException), innerException, source) : ArgumentException(std::nullopt, message, innerException, source){ }
{
HRresult = HResults::HR_COR_E_ARGUMENT;
}
ArgumentException(OptionalString const& paramName, OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) ArgumentException(OptionalString const& paramName, OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: paramName(paramName), Exception(message.value_or(SR::Arg_ArgumentException), innerException, source) : paramName(paramName), Exception(message.value_or(SR::Arg_ArgumentException), innerException, source)
{ {
@ -224,21 +217,14 @@ namespace csharp {
class ArgumentNullException : public ArgumentException { class ArgumentNullException : public ArgumentException {
public: public:
ArgumentNullException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current()) ArgumentNullException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current())
: ArgumentException(message.value_or(SR::ArgumentNull_Generic), source) : ArgumentNullException(std::nullopt, message, nullptr, source){ }
{
HRresult = HResults::HR_E_POINTER;
};
ArgumentNullException(OptionalString const& paramName, OptionalString const& message, std::source_location const& source = std::source_location::current()) ArgumentNullException(OptionalString const& paramName, OptionalString const& message, std::source_location const& source = std::source_location::current())
: ArgumentException(paramName, message.value_or(SR::ArgumentNull_Generic), source) : ArgumentNullException(paramName, message, nullptr, source){ }
{
HRresult = HResults::HR_E_POINTER;
};
ArgumentNullException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) ArgumentNullException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: ArgumentException(message.value_or(SR::ArgumentNull_Generic), innerException, source) : ArgumentNullException(std::nullopt, message, innerException, source){ }
{
HRresult = HResults::HR_E_POINTER;
}
ArgumentNullException(OptionalString const& paramName, OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) ArgumentNullException(OptionalString const& paramName, OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: ArgumentException(paramName, message.value_or(SR::ArgumentNull_Generic), innerException, source) : ArgumentException(paramName, message.value_or(SR::ArgumentNull_Generic), innerException, source)
{ {
@ -257,21 +243,14 @@ namespace csharp {
class ArgumentOutOfRangeException : public ArgumentException { class ArgumentOutOfRangeException : public ArgumentException {
public: public:
ArgumentOutOfRangeException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current()) ArgumentOutOfRangeException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current())
: ArgumentException(message.value_or(SR::Arg_ArgumentOutOfRangeException), source) : ArgumentOutOfRangeException(message, std::nullopt, nullptr, source) { }
{
HRresult = HResults::HR_E_POINTER;
};
ArgumentOutOfRangeException(OptionalString const& message, OptionalString const& paramName, std::source_location const& source = std::source_location::current()) ArgumentOutOfRangeException(OptionalString const& message, OptionalString const& paramName, std::source_location const& source = std::source_location::current())
: ArgumentException(message.value_or(SR::Arg_ArgumentOutOfRangeException), paramName, source) : ArgumentOutOfRangeException(message, paramName, nullptr, source) { }
{
HRresult = HResults::HR_E_POINTER;
};
ArgumentOutOfRangeException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) ArgumentOutOfRangeException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: ArgumentException(message.value_or(SR::Arg_ArgumentOutOfRangeException), innerException, source) : ArgumentOutOfRangeException(message, std::nullopt, innerException, source) { }
{
HRresult = HResults::HR_E_POINTER;
}
ArgumentOutOfRangeException(OptionalString const& message, OptionalString const& paramName, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) ArgumentOutOfRangeException(OptionalString const& message, OptionalString const& paramName, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: ArgumentException(message.value_or(SR::Arg_ArgumentOutOfRangeException), paramName, innerException, source) : ArgumentException(message.value_or(SR::Arg_ArgumentOutOfRangeException), paramName, innerException, source)
{ {
@ -282,10 +261,7 @@ namespace csharp {
class SystemException : public Exception { class SystemException : public Exception {
public: public:
SystemException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current()) SystemException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current())
: Exception(message.value_or(SR::Arg_SystemException), source) : SystemException(message, nullptr, source) { }
{
HRresult = HResults::HR_COR_E_SYSTEM;
}
SystemException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) SystemException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: Exception(message.value_or(SR::Arg_SystemException), innerException, source) : Exception(message.value_or(SR::Arg_SystemException), innerException, source)
@ -298,10 +274,8 @@ namespace csharp {
class InvalidOperationException : public SystemException { class InvalidOperationException : public SystemException {
public: public:
InvalidOperationException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current()) InvalidOperationException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current())
: SystemException(message.value_or(SR::Arg_InvalidOperationException), source) : InvalidOperationException(message, nullptr, source)
{ { }
HRresult = HResults::HR_COR_E_INVALIDOPERATION;
}
InvalidOperationException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) InvalidOperationException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: SystemException(message.value_or(SR::Arg_InvalidOperationException), innerException, source) : SystemException(message.value_or(SR::Arg_InvalidOperationException), innerException, source)
@ -315,10 +289,8 @@ namespace csharp {
class NotSupportedException : public SystemException { class NotSupportedException : public SystemException {
public: public:
NotSupportedException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current()) NotSupportedException(OptionalString const& message = std::nullopt, std::source_location const& source = std::source_location::current())
: SystemException(message.value_or(SR::Arg_NotSupportedException), source) : NotSupportedException(message, nullptr, source)
{ { }
HRresult = HResults::HR_COR_E_INVALIDOPERATION;
}
NotSupportedException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) NotSupportedException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: SystemException(message.value_or(SR::Arg_NotSupportedException), innerException, source) : SystemException(message.value_or(SR::Arg_NotSupportedException), innerException, source)
@ -331,10 +303,8 @@ namespace csharp {
class UnauthorizedAccessException : public SystemException { class UnauthorizedAccessException : public SystemException {
public: public:
UnauthorizedAccessException(OptionalString const& message, std::source_location const& source = std::source_location::current()) UnauthorizedAccessException(OptionalString const& message, std::source_location const& source = std::source_location::current())
: SystemException(message.value_or(SR::Arg_UnauthorizedAccessException), source) : UnauthorizedAccessException(message, nullptr, source)
{ {}
HRresult = HResults::HR_COR_E_UNAUTHORIZEDACCESS;
}
UnauthorizedAccessException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current()) UnauthorizedAccessException(OptionalString const& message, std::shared_ptr<Exception> const& innerException, std::source_location const& source = std::source_location::current())
: SystemException(message.value_or(SR::Arg_UnauthorizedAccessException), innerException, source) : SystemException(message.value_or(SR::Arg_UnauthorizedAccessException), innerException, source)