mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Edit Data: Better errors for possible truncation (#514)
* Fix to make sql exceptions surface properly to user (with important notes!) * Adding support for detecting column size issues when updating a cell * Adding unit tests for the exception on read scenario
This commit is contained in:
committed by
Karl Burtram
parent
9499d73cec
commit
e9bc97e290
@@ -27,7 +27,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
Keys.Culture = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static string CredentialsServiceInvalidCriticalHandle
|
||||
{
|
||||
@@ -35,7 +35,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.CredentialsServiceInvalidCriticalHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string CredentialsServicePasswordLengthExceeded
|
||||
{
|
||||
@@ -43,7 +43,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.CredentialsServicePasswordLengthExceeded);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string CredentialsServiceTargetForDelete
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.CredentialsServiceTargetForDelete);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string CredentialsServiceTargetForLookup
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.CredentialsServiceTargetForLookup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string CredentialServiceWin32CredentialDisposed
|
||||
{
|
||||
@@ -67,7 +67,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.CredentialServiceWin32CredentialDisposed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string ServiceAlreadyRegistered
|
||||
{
|
||||
@@ -75,7 +75,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.ServiceAlreadyRegistered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string MultipleServicesFound
|
||||
{
|
||||
@@ -83,7 +83,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.MultipleServicesFound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string IncompatibleServiceForExtensionLoader
|
||||
{
|
||||
@@ -91,7 +91,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.IncompatibleServiceForExtensionLoader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string ServiceProviderNotSet
|
||||
{
|
||||
@@ -99,7 +99,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.ServiceProviderNotSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string ServiceNotFound
|
||||
{
|
||||
@@ -107,7 +107,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.ServiceNotFound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string ServiceNotOfExpectedType
|
||||
{
|
||||
@@ -115,7 +115,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.ServiceNotOfExpectedType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string HostingUnexpectedEndOfStream
|
||||
{
|
||||
@@ -123,7 +123,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.HostingUnexpectedEndOfStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string HostingHeaderMissingColon
|
||||
{
|
||||
@@ -131,7 +131,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.HostingHeaderMissingColon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string HostingHeaderMissingContentLengthHeader
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.HostingHeaderMissingContentLengthHeader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string HostingHeaderMissingContentLengthValue
|
||||
{
|
||||
@@ -147,7 +147,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return Keys.GetString(Keys.HostingHeaderMissingContentLengthValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Keys
|
||||
@@ -155,52 +155,52 @@ namespace Microsoft.SqlTools.Hosting
|
||||
static ResourceManager resourceManager = new ResourceManager("Microsoft.SqlTools.Hosting.Localization.SR", typeof(SR).GetTypeInfo().Assembly);
|
||||
|
||||
static CultureInfo _culture = null;
|
||||
|
||||
|
||||
public const string CredentialsServiceInvalidCriticalHandle = "CredentialsServiceInvalidCriticalHandle";
|
||||
|
||||
|
||||
public const string CredentialsServicePasswordLengthExceeded = "CredentialsServicePasswordLengthExceeded";
|
||||
|
||||
|
||||
public const string CredentialsServiceTargetForDelete = "CredentialsServiceTargetForDelete";
|
||||
|
||||
|
||||
public const string CredentialsServiceTargetForLookup = "CredentialsServiceTargetForLookup";
|
||||
|
||||
|
||||
public const string CredentialServiceWin32CredentialDisposed = "CredentialServiceWin32CredentialDisposed";
|
||||
|
||||
|
||||
public const string ServiceAlreadyRegistered = "ServiceAlreadyRegistered";
|
||||
|
||||
|
||||
public const string MultipleServicesFound = "MultipleServicesFound";
|
||||
|
||||
|
||||
public const string IncompatibleServiceForExtensionLoader = "IncompatibleServiceForExtensionLoader";
|
||||
|
||||
|
||||
public const string ServiceProviderNotSet = "ServiceProviderNotSet";
|
||||
|
||||
|
||||
public const string ServiceNotFound = "ServiceNotFound";
|
||||
|
||||
|
||||
public const string ServiceNotOfExpectedType = "ServiceNotOfExpectedType";
|
||||
|
||||
|
||||
public const string HostingUnexpectedEndOfStream = "HostingUnexpectedEndOfStream";
|
||||
|
||||
|
||||
public const string HostingHeaderMissingColon = "HostingHeaderMissingColon";
|
||||
|
||||
|
||||
public const string HostingHeaderMissingContentLengthHeader = "HostingHeaderMissingContentLengthHeader";
|
||||
|
||||
|
||||
public const string HostingHeaderMissingContentLengthValue = "HostingHeaderMissingContentLengthValue";
|
||||
|
||||
|
||||
|
||||
public const string CredentialsServiceInvalidCriticalHandle = "CredentialsServiceInvalidCriticalHandle";
|
||||
|
||||
|
||||
public const string CredentialsServicePasswordLengthExceeded = "CredentialsServicePasswordLengthExceeded";
|
||||
|
||||
|
||||
public const string CredentialsServiceTargetForDelete = "CredentialsServiceTargetForDelete";
|
||||
|
||||
|
||||
public const string CredentialsServiceTargetForLookup = "CredentialsServiceTargetForLookup";
|
||||
|
||||
|
||||
public const string CredentialServiceWin32CredentialDisposed = "CredentialServiceWin32CredentialDisposed";
|
||||
|
||||
|
||||
public const string ServiceAlreadyRegistered = "ServiceAlreadyRegistered";
|
||||
|
||||
|
||||
public const string MultipleServicesFound = "MultipleServicesFound";
|
||||
|
||||
|
||||
public const string IncompatibleServiceForExtensionLoader = "IncompatibleServiceForExtensionLoader";
|
||||
|
||||
|
||||
public const string ServiceProviderNotSet = "ServiceProviderNotSet";
|
||||
|
||||
|
||||
public const string ServiceNotFound = "ServiceNotFound";
|
||||
|
||||
|
||||
public const string ServiceNotOfExpectedType = "ServiceNotOfExpectedType";
|
||||
|
||||
|
||||
public const string HostingUnexpectedEndOfStream = "HostingUnexpectedEndOfStream";
|
||||
|
||||
|
||||
public const string HostingHeaderMissingColon = "HostingHeaderMissingColon";
|
||||
|
||||
|
||||
public const string HostingHeaderMissingContentLengthHeader = "HostingHeaderMissingContentLengthHeader";
|
||||
|
||||
|
||||
public const string HostingHeaderMissingContentLengthValue = "HostingHeaderMissingContentLengthValue";
|
||||
|
||||
|
||||
private Keys()
|
||||
{ }
|
||||
@@ -221,7 +221,7 @@ namespace Microsoft.SqlTools.Hosting
|
||||
{
|
||||
return resourceManager.GetString(key, _culture);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,61 +120,61 @@
|
||||
<data name="CredentialsServiceInvalidCriticalHandle" xml:space="preserve">
|
||||
<value>Invalid CriticalHandle!</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="CredentialsServicePasswordLengthExceeded" xml:space="preserve">
|
||||
<value>The password has exceeded 512 bytes</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="CredentialsServiceTargetForDelete" xml:space="preserve">
|
||||
<value>Target must be specified to delete a credential</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="CredentialsServiceTargetForLookup" xml:space="preserve">
|
||||
<value>Target must be specified to check existance of a credential</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="CredentialServiceWin32CredentialDisposed" xml:space="preserve">
|
||||
<value>Win32Credential object is already disposed</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="ServiceAlreadyRegistered" xml:space="preserve">
|
||||
<value>Cannot register service for type {0}, one or more services already registered</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="MultipleServicesFound" xml:space="preserve">
|
||||
<value>Multiple services found for type {0}, expected only 1</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="IncompatibleServiceForExtensionLoader" xml:space="preserve">
|
||||
<value>Service of type {0} cannot be created by ExtensionLoader<{1}></value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="ServiceProviderNotSet" xml:space="preserve">
|
||||
<value>SetServiceProvider() was not called to establish the required service provider</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="ServiceNotFound" xml:space="preserve">
|
||||
<value>Service {0} was not found in the service provider</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="ServiceNotOfExpectedType" xml:space="preserve">
|
||||
<value>Service of Type {0} is not compatible with registered Type {1}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="HostingUnexpectedEndOfStream" xml:space="preserve">
|
||||
<value>MessageReader's input stream ended unexpectedly, terminating</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="HostingHeaderMissingColon" xml:space="preserve">
|
||||
<value>Message header must separate key and value using ':'</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="HostingHeaderMissingContentLengthHeader" xml:space="preserve">
|
||||
<value>Fatal error: Content-Length header must be provided</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="HostingHeaderMissingContentLengthValue" xml:space="preserve">
|
||||
<value>Fatal error: Content-Length value is not an integer</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</root>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" original="sr.resx" source-language="en">
|
||||
<body>
|
||||
<trans-unit id="CredentialsServiceInvalidCriticalHandle">
|
||||
<source>Invalid CriticalHandle!</source>
|
||||
<target state="new">Invalid CriticalHandle!</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialsServicePasswordLengthExceeded">
|
||||
<source>The password has exceeded 512 bytes</source>
|
||||
<target state="new">The password has exceeded 512 bytes</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialsServiceTargetForDelete">
|
||||
<source>Target must be specified to delete a credential</source>
|
||||
<target state="new">Target must be specified to delete a credential</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialsServiceTargetForLookup">
|
||||
<source>Target must be specified to check existance of a credential</source>
|
||||
<target state="new">Target must be specified to check existance of a credential</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialServiceWin32CredentialDisposed">
|
||||
<source>Win32Credential object is already disposed</source>
|
||||
<target state="new">Win32Credential object is already disposed</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingUnexpectedEndOfStream">
|
||||
<source>MessageReader's input stream ended unexpectedly, terminating</source>
|
||||
<target state="new">MessageReader's input stream ended unexpectedly, terminating</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingHeaderMissingColon">
|
||||
<source>Message header must separate key and value using ':'</source>
|
||||
<target state="new">Message header must separate key and value using ':'</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingHeaderMissingContentLengthHeader">
|
||||
<source>Fatal error: Content-Length header must be provided</source>
|
||||
<target state="new">Fatal error: Content-Length header must be provided</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingHeaderMissingContentLengthValue">
|
||||
<source>Fatal error: Content-Length value is not an integer</source>
|
||||
<target state="new">Fatal error: Content-Length value is not an integer</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceAlreadyRegistered">
|
||||
<source>Cannot register service for type {0}, one or more services already registered</source>
|
||||
<target state="new">Cannot register service for type {0}, one or more services already registered</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="MultipleServicesFound">
|
||||
<source>Multiple services found for type {0}, expected only 1</source>
|
||||
<target state="new">Multiple services found for type {0}, expected only 1</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="IncompatibleServiceForExtensionLoader">
|
||||
<source>Service of type {0} cannot be created by ExtensionLoader<{1}></source>
|
||||
<target state="new">Service of type {0} cannot be created by ExtensionLoader<{1}></target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceProviderNotSet">
|
||||
<source>SetServiceProvider() was not called to establish the required service provider</source>
|
||||
<target state="new">SetServiceProvider() was not called to establish the required service provider</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceNotFound">
|
||||
<source>Service {0} was not found in the service provider</source>
|
||||
<target state="new">Service {0} was not found in the service provider</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceNotOfExpectedType">
|
||||
<source>Service of Type {0} is not compatible with registered Type {1}</source>
|
||||
<target state="new">Service of Type {0} is not compatible with registered Type {1}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" original="sr.resx" source-language="en">
|
||||
<body>
|
||||
<trans-unit id="CredentialsServiceInvalidCriticalHandle">
|
||||
<source>Invalid CriticalHandle!</source>
|
||||
<target state="new">Invalid CriticalHandle!</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialsServicePasswordLengthExceeded">
|
||||
<source>The password has exceeded 512 bytes</source>
|
||||
<target state="new">The password has exceeded 512 bytes</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialsServiceTargetForDelete">
|
||||
<source>Target must be specified to delete a credential</source>
|
||||
<target state="new">Target must be specified to delete a credential</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialsServiceTargetForLookup">
|
||||
<source>Target must be specified to check existance of a credential</source>
|
||||
<target state="new">Target must be specified to check existance of a credential</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="CredentialServiceWin32CredentialDisposed">
|
||||
<source>Win32Credential object is already disposed</source>
|
||||
<target state="new">Win32Credential object is already disposed</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingUnexpectedEndOfStream">
|
||||
<source>MessageReader's input stream ended unexpectedly, terminating</source>
|
||||
<target state="new">MessageReader's input stream ended unexpectedly, terminating</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingHeaderMissingColon">
|
||||
<source>Message header must separate key and value using ':'</source>
|
||||
<target state="new">Message header must separate key and value using ':'</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingHeaderMissingContentLengthHeader">
|
||||
<source>Fatal error: Content-Length header must be provided</source>
|
||||
<target state="new">Fatal error: Content-Length header must be provided</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="HostingHeaderMissingContentLengthValue">
|
||||
<source>Fatal error: Content-Length value is not an integer</source>
|
||||
<target state="new">Fatal error: Content-Length value is not an integer</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceAlreadyRegistered">
|
||||
<source>Cannot register service for type {0}, one or more services already registered</source>
|
||||
<target state="new">Cannot register service for type {0}, one or more services already registered</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="MultipleServicesFound">
|
||||
<source>Multiple services found for type {0}, expected only 1</source>
|
||||
<target state="new">Multiple services found for type {0}, expected only 1</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="IncompatibleServiceForExtensionLoader">
|
||||
<source>Service of type {0} cannot be created by ExtensionLoader<{1}></source>
|
||||
<target state="new">Service of type {0} cannot be created by ExtensionLoader<{1}></target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceProviderNotSet">
|
||||
<source>SetServiceProvider() was not called to establish the required service provider</source>
|
||||
<target state="new">SetServiceProvider() was not called to establish the required service provider</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceNotFound">
|
||||
<source>Service {0} was not found in the service provider</source>
|
||||
<target state="new">Service {0} was not found in the service provider</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="ServiceNotOfExpectedType">
|
||||
<source>Service of Type {0} is not compatible with registered Type {1}</source>
|
||||
<target state="new">Service of Type {0} is not compatible with registered Type {1}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
Reference in New Issue
Block a user