< Summary

Class:Microsoft.Azure.Batch.ParallelOperationsException
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\BatchClientExceptions.cs
Covered lines:12
Uncovered lines:0
Coverable lines:12
Total lines:89
Line coverage:100% (12 of 12)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-100%100%
ToString()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\BatchClientExceptions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for license information.
 3
 4namespace Microsoft.Azure.Batch
 5{
 6    using System;
 7    using System.Collections.Generic;
 8    using System.Text;
 9    using Microsoft.Azure.Batch.Common;
 10
 11    /// <summary>
 12    /// An exception thrown by the Batch client.
 13    /// </summary>
 14    public class BatchClientException : BatchException
 15    {
 16        internal BatchClientException(string message = null, Exception inner = null) : base(null, message, inner)
 17        {
 18        }
 19    }
 20
 21    /// <summary>
 22    /// The exception that is thrown when the AddTaskCollection operation is terminated.
 23    /// </summary>
 24    public class AddTaskCollectionTerminatedException : BatchClientException
 25    {
 26        /// <summary>
 27        /// Gets the <see cref="AddTaskResult"/> for the task which caused the exception.
 28        /// </summary>
 29        /// <remarks>
 30        /// More than one task may have failed. In order to see the full list, use an <see cref="AddTaskCollectionResult
 31        /// </remarks>
 32        public AddTaskResult AddTaskResult { get; }
 33
 34        internal AddTaskCollectionTerminatedException(AddTaskResult result, Exception inner = null) :
 35            base(GenerateMessageString(result), inner)
 36        {
 37            this.AddTaskResult = result;
 38        }
 39
 40        private static string GenerateMessageString(AddTaskResult result)
 41        {
 42            return string.Format(System.Globalization.CultureInfo.InvariantCulture, BatchErrorMessages.AddTaskCollection
 43        }
 44    }
 45
 46    /// <summary>
 47    /// An exception raised when one or more operations in a parallel set of operations fails.
 48    /// The <see cref="AggregateException.InnerExceptions"/> collection contains the exceptions for each of the failed o
 49    /// </summary>
 50    public class ParallelOperationsException : AggregateException
 51    {
 152        internal ParallelOperationsException(IEnumerable<Exception> innerExceptions) : base(innerExceptions)
 53        {
 154        }
 55
 456        internal ParallelOperationsException(string message, IEnumerable<Exception> innerExceptions) : base(message, inn
 57        {
 458        }
 59
 60        /// <summary>
 61        /// Creates and returns a string representation of the current <see cref="ParallelOperationsException"/>.
 62        /// </summary>
 63        /// <returns>A string representation of the current exception.</returns>
 64        public override string ToString()
 65        {
 466            StringBuilder builder = new StringBuilder();
 467            builder.Append($"{this.GetType()}: ").AppendLine(this.Message);
 468            builder.AppendLine(this.StackTrace);
 469            builder.AppendLine();
 70
 2271            for (int i = 0; i < this.InnerExceptions.Count; i++)
 72            {
 773                builder.Append($"Exception #{i}:").AppendLine();
 774                builder.Append(this.InnerExceptions[i]).AppendLine().AppendLine();
 75            }
 76
 477            return builder.ToString();
 78        }
 79    }
 80
 81    internal class RunOnceException : BatchException
 82    {
 83        internal RunOnceException(string message = null, Exception inner = null)
 84            : base(null, message, inner)
 85        {
 86
 87        }
 88    }
 89}

Methods/Properties

.ctor(...)
.ctor(...)
ToString()