mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Formats code comments as sentences in the production sources.
Capitalizes the first word and adds the terminal period across the domain, application, data access, infrastructure, API and web layers and the plugins. No comment is reworded. The change also normalizes the TODO bodies to lowercase, leaves commented-out code untouched, corrects the Threat/Treat typo and the dangling hyphen in the exception middleware, and collapses two accidental repeated terminal periods.
This commit is contained in:
1 parent
88455fec9c
commit
727aa33318
142 files changed
+403
-403
No files matched your search
@@ -33,16 +33,16 @@ public static class ExceptionUtilities
|
||||
/// <returns>A list of exceptions representing the list of inner exception(s) of <paramref name="exception"/>.</returns>
|
||||
public static IEnumerable<Exception> GetInnerExceptions(this Exception exception, int maximumDepth = 5)
|
||||
{
|
||||
// check if there are any more inner exceptions to return
|
||||
// Check if there are any more inner exceptions to return.
|
||||
if (exception == null || maximumDepth <= 0)
|
||||
yield break;
|
||||
// yield the current level exception itself
|
||||
// Yield the current level exception itself.
|
||||
yield return exception;
|
||||
// if the exception is an AggregateException, treat it differently and get its all exceptions
|
||||
// If the exception is an AggregateException, treat it differently and get its all exceptions.
|
||||
if (exception is AggregateException aggregateException)
|
||||
foreach (Exception? innerException in aggregateException.InnerExceptions.SelectMany(innerException => innerException.GetInnerExceptions(maximumDepth - 1)))
|
||||
yield return innerException;
|
||||
// if it's a normal exception, recursively get its list of inner exceptions and yield them
|
||||
// If it's a normal exception, recursively get its list of inner exceptions and yield them.
|
||||
foreach (Exception innerException in exception.InnerException?.GetInnerExceptions(maximumDepth - 1) ?? [])
|
||||
yield return innerException;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user