Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use corresponding exception message, if null passed #90505

Merged
merged 8 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
OwnageIsMagic committed Dec 25, 2023
commit 0edc44a79a8ffa7f754200bb40fa30d8233984f7
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public AsnContentException()
}

public AsnContentException(string? message)
: base(message ?? SR.ContentException_DefaultMessage ?? SR.ContentException_DefaultMessage)
: base(message ?? SR.ContentException_DefaultMessage)
{
}

public AsnContentException(string? message, Exception? inner)
: base(message ?? SR.ContentException_DefaultMessage ?? SR.ContentException_DefaultMessage, inner)
: base(message ?? SR.ContentException_DefaultMessage, inner)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public InsufficientMemoryException(string? message)
public InsufficientMemoryException(string? message, Exception? innerException)
: base(message ??
#if CORECLR
GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory)
GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory),
#else
SR.Arg_OutOfMemoryException
SR.Arg_OutOfMemoryException,
#endif
, innerException)
innerException)
{
HResult = HResults.COR_E_INSUFFICIENTMEMORY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public OutOfMemoryException(string? message)
public OutOfMemoryException(string? message, Exception? innerException)
: base(message ??
#if CORECLR
GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory)
GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory),
#else
SR.Arg_OutOfMemoryException
SR.Arg_OutOfMemoryException,
#endif
, innerException)
innerException)
{
HResult = HResults.COR_E_OUTOFMEMORY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public override string ToString()
s.Append($"{GetType()} (0x{HResult:X8})");

string message = Message;
if (!string.IsNullOrEmpty(message ?? SR.Arg_COMException))
if (!string.IsNullOrEmpty(message))
{
s.Append(": ").Append(message ?? SR.Arg_COMException);
s.Append(": ").Append(message);
}

Exception? innerException = InnerException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public ThreadInterruptedException(string? message)
public ThreadInterruptedException(string? message, Exception? innerException)
: base(message ??
#if CORECLR
GetMessageFromNativeResources(ExceptionMessageKind.ThreadInterrupted)
GetMessageFromNativeResources(ExceptionMessageKind.ThreadInterrupted),
#else
SR.Threading_ThreadInterrupted
SR.Threading_ThreadInterrupted,
#endif
, innerException)
innerException)
{
HResult = HResults.COR_E_THREADINTERRUPTED;
}
Expand Down