// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.JsonPatch.Operations; namespace Microsoft.AspNet.JsonPatch.Exceptions { public class JsonPatchException : JsonPatchException where T : class { public Operation FailedOperation { get; private set; } public new T AffectedObject { get; private set; } private string _message = ""; public override string Message { get { return _message; } } public JsonPatchException() { } public JsonPatchException(JsonPatchError jsonPatchError) { FailedOperation = jsonPatchError.Operation; _message = jsonPatchError.ErrorMessage; AffectedObject = jsonPatchError.AffectedObject; } public JsonPatchException(JsonPatchError jsonPatchError, Exception innerException) : this(jsonPatchError) { InnerException = innerException; } } }