-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(.NET): always include listed errors in Collection of Errs msg
- Loading branch information
Showing
1 changed file
with
13 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 13 additions & 2 deletions
15
AwsEncryptionSDK/runtimes/net/Generated/AwsEncryptionSdk/CollectionOfErrors.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
|
||
using System; | ||
using AWS.Cryptography.EncryptionSDK; | ||
using System.Collections.Generic; | ||
|
||
namespace AWS.Cryptography.EncryptionSDK | ||
{ | ||
public class CollectionOfErrors : Exception | ||
{ | ||
public readonly System.Collections.Generic.List<Exception> list; | ||
public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message) { this.list = list; } | ||
public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } | ||
public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List<Exception>(); } | ||
public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List<Exception>(); } | ||
|
||
private static string ListAsString(List<Exception> list) | ||
{ | ||
if (list.Count < 1) return ""; | ||
string [] msgArr = new string [list.Count]; | ||
for (int i = 0; i < list.Count; i++) | ||
msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; | ||
return String.Join("\n\t", msgArr); | ||
} | ||
} | ||
|
||
} |