From abd3c9c65c47f49a1d8b5d5357b4818528d1a3b3 Mon Sep 17 00:00:00 2001 From: soukoku Date: Mon, 23 Mar 2015 07:35:34 -0400 Subject: [PATCH] Updated exception message to include capability id. --- src/NTwain/CapabilityReader.cs | 3 ++- src/NTwain/Properties/Resources.Designer.cs | 13 ++----------- src/NTwain/Properties/Resources.resx | 5 +---- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/NTwain/CapabilityReader.cs b/src/NTwain/CapabilityReader.cs index 994e81f..45ce2ed 100644 --- a/src/NTwain/CapabilityReader.cs +++ b/src/NTwain/CapabilityReader.cs @@ -75,7 +75,8 @@ namespace NTwain ContainerType = capability.ContainerType, }.ReadRangeValue(baseAddr); default: - throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.CapHasBadContainer, capability.ContainerType), "capability"); + throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, + Resources.CapHasBadContainer, capability.Capability, capability.ContainerType), "capability"); } } finally diff --git a/src/NTwain/Properties/Resources.Designer.cs b/src/NTwain/Properties/Resources.Designer.cs index 5636576..9ebbf18 100644 --- a/src/NTwain/Properties/Resources.Designer.cs +++ b/src/NTwain/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -79,7 +79,7 @@ namespace NTwain.Properties { } /// - /// Looks up a localized string similar to Capability has invalid container type {0}.. + /// Looks up a localized string similar to Capability {0} has invalid container type {1}.. /// internal static string CapHasBadContainer { get { @@ -87,15 +87,6 @@ namespace NTwain.Properties { } } - /// - /// Looks up a localized string similar to Capability contains no data.. - /// - internal static string CapHasNoData { - get { - return ResourceManager.GetString("CapHasNoData", resourceCulture); - } - } - /// /// Looks up a localized string similar to The string value has exceeded the maximum length allowed.. /// diff --git a/src/NTwain/Properties/Resources.resx b/src/NTwain/Properties/Resources.resx index a8b8d9f..6c9172c 100644 --- a/src/NTwain/Properties/Resources.resx +++ b/src/NTwain/Properties/Resources.resx @@ -124,10 +124,7 @@ Invalid value type for {0}. - Capability has invalid container type {0}. - - - Capability contains no data. + Capability {0} has invalid container type {1}. The string value has exceeded the maximum length allowed.