This project has moved. For the latest updates, please go here.
1

Closed

Insert with special characters

description

I've been testing the project and it looks very promising. I found a problem though, as the code doesn't seem to handle special characters, like scandinavian characters.

Given a test class:
public class SimpleTest
{
    public string PartitionKey { get; set; }
    public string RowKey { get; set; }
    public DateTime Timestamp { get; set; }

    public string Data { get; set; }
}
This works:
        var test = new SimpleTest() {Data = "hello", PartitionKey = "1", RowKey = DateTime.Now.Ticks.ToString()};

        client.Insert(test);
But this throws an exception (notice the one extra char in data):
        var test = new SimpleTest() {Data = "helloä", PartitionKey = "1", RowKey = DateTime.Now.Ticks.ToString()};

        client.Insert(test);
The exception:
CodeSuperior.Lucifure.StashRuntimeException was unhandled
HResult=-2146232832
Message=Unexpected runtime error. Please examine the InnerException for more information.
Source=Lucifure.Stash
Error=2000
StackTrace:
   at CodeSuperior.Lucifure.Exp.wrap(FSharpFunc`2 f)
   at CodeSuperior.Lucifure.StashClient`1.Insert(a instance)
   at ConsoleApplication20.Program.Main(String[] args) in Program.cs: line 60
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Net.WebException
   HResult=-2146233079
   Message=The request was aborted: The request was canceled.
   Source=System
   StackTrace:
        at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)
        at System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState)
        at System.Net.ConnectStream.Dispose(Boolean disposing)
        at System.IO.Stream.Close()
        at System.IO.StreamWriter.Dispose(Boolean disposing)
        at System.IO.TextWriter.Dispose()
        at CodeSuperior.Lucifure.RestRequestBuilder.AddContent(Guid batchId, String content, WebRequest request)
        at .$RestRequestBuilder.CreateRequest@173.Invoke(String content, WebRequest request)
        at CodeSuperior.Lucifure.RestRequestBuilder.CreateRequest(String command, CommandType commandType, String content, String etag, Guid batchId)
        at CodeSuperior.Lucifure.StashClient`1.insert(a instance)
        at .$StashClient.Insert@690.Invoke(Unit unitVar0)
        at CodeSuperior.Lucifure.Exp.wrap(FSharpFunc`2 f)
   InnerException: System.IO.IOException
        HResult=-2146232800
        Message=Cannot close stream until all bytes are written.
        Source=System
        StackTrace:
             at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)
        InnerException:
Closed Feb 9, 2013 at 10:13 PM by hocho
Fixed.

comments

Miksu wrote Jan 20, 2013 at 8:11 AM

Ah, the code didn't print out as expected. I hope it's still readable though :)

hocho wrote Jan 21, 2013 at 1:00 AM

Miksu, thanks for bringing this to my attention. I have checked in the fix.
Can you confirm if it fixes the issue?

Miksu wrote Jan 22, 2013 at 9:12 AM

Great, thank you for the fix. It seems to have solved the issue.

wrote Feb 9, 2013 at 10:13 PM

wrote Feb 14, 2013 at 2:22 AM

wrote May 16, 2013 at 6:57 AM