fetch failing on 0.9.8:5685

On a fetch call to a shut down server, I am getting the following runtime exception. This used to work on the previous 0.9.7 build.

The exception is thrown on a simple fetch call, even without consequent then or catch calls. The normal behaviour is to reach an eventual catch method, where the connection refused message would be handled.

Preview detected an unhandled exception: System.AggregateException: One or more errors occurred. ---> Fuse.Scripting.ScriptException: Name: TypeError: Cannot create property 'type' on string 'Error: ConnectFailure (Connection refused)'
ErrorMessage: Uncaught TypeError: Cannot create property 'type' on string 'Error: ConnectFailure (Connection refused)'
FileName: window-XMLHttpRequest
LineNumber: 199
JS StackTrace: TypeError: Cannot create property 'type' on string 'Error: ConnectFailure (Connection refused)'
    at fuseXMLHttpRequest.dispatch (window-XMLHttpRequest:199:13)
    at self._fuseHttpRequest.onerror (window-XMLHttpRequest:142:13)

  at Fuse.Scripting.V8.Context.OnScriptException (Fuse.Scripting.V8.Simple.ScriptException e) [0x00000] in <filename unknown>:0 
  at Fuse.Scripting.V8.Simple.DelegateScriptExceptionHandler.Handle (Fuse.Scripting.V8.Simple.ScriptException e) [0x00000] in <filename unknown>:0 
  at Fuse.Scripting.V8.Simple.ScriptExceptionHandler.SwigDirectorHandle (IntPtr e) [0x00000] in <filename unknown>:0 
  at (wrapper native-to-managed) Fuse.Scripting.V8.Simple.ScriptExceptionHandler:SwigDirectorHandle (intptr)
  at (wrapper managed-to-native) Fuse.Scripting.V8.Simple.v8PINVOKE:Function_Call (System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef)
  at Fuse.Scripting.V8.Simple.Function.Call (Fuse.Scripting.V8.Simple.ValueVector args) [0x00000] in <filename unknown>:0 
  at Fuse.Scripting.V8.Function.Call (System.Object[] args) [0x00000] in <filename unknown>:0 
  at Fuse.Reactive.FuseJS.Http+FuseJSHttpRequest.OnError (Uno.Net.Http.HttpMessageHandlerRequest res, System.String error) [0x00000] in <filename unknown>:0 
  at Uno.Net.Http.HttpMessageHandlerRequest+DispatchClosure`1[System.String].Run () [0x00000] in <filename unknown>:0 
  at Fuse.Reactive.ThreadWorker.Run () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Fuse.UpdateManager.Update (Fuse.Stage stage) [0x00000] in <filename unknown>:0 
  at Fuse.UpdateManager.Update () [0x00000] in <filename unknown>:0 
  at Fuse.AppBase.OnUpdate () [0x00000] in <filename unknown>:0 
  at Outracks.Simulator.Application.OnUpdate () [0x00000] in <filename unknown>:0 
  at Fuse.App.Update () [0x00000] in <filename unknown>:0 
---> (Inner Exception #0) Fuse.Scripting.ScriptException: Name: TypeError: Cannot create property 'type' on string 'Error: ConnectFailure (Connection refused)'
ErrorMessage: Uncaught TypeError: Cannot create property 'type' on string 'Error: ConnectFailure (Connection refused)'
FileName: window-XMLHttpRequest
LineNumber: 199
JS StackTrace: TypeError: Cannot create property 'type' on string 'Error: ConnectFailure (Connection refused)'
    at fuseXMLHttpRequest.dispatch (window-XMLHttpRequest:199:13)
    at self._fuseHttpRequest.onerror (window-XMLHttpRequest:142:13)

  at Fuse.Scripting.V8.Context.OnScriptException (Fuse.Scripting.V8.Simple.ScriptException e) [0x00000] in <filename unknown>:0 
  at Fuse.Scripting.V8.Simple.DelegateScriptExceptionHandler.Handle (Fuse.Scripting.V8.Simple.ScriptException e) [0x00000] in <filename unknown>:0 
  at Fuse.Scripting.V8.Simple.ScriptExceptionHandler.SwigDirectorHandle (IntPtr e) [0x00000] in <filename unknown>:0 
  at (wrapper native-to-managed) Fuse.Scripting.V8.Simple.ScriptExceptionHandler:SwigDirectorHandle (intptr)
  at (wrapper managed-to-native) Fuse.Scripting.V8.Simple.v8PINVOKE:Function_Call (System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef)
  at Fuse.Scripting.V8.Simple.Function.Call (Fuse.Scripting.V8.Simple.ValueVector args) [0x00000] in <filename unknown>:0 
  at Fuse.Scripting.V8.Function.Call (System.Object[] args) [0x00000] in <filename unknown>:0 
  at Fuse.Reactive.FuseJS.Http+FuseJSHttpRequest.OnError (Uno.Net.Http.HttpMessageHandlerRequest res, System.String error) [0x00000] in <filename unknown>:0 
  at Uno.Net.Http.HttpMessageHandlerRequest+DispatchClosure`1[System.String].Run () [0x00000] in <filename unknown>:0 
  at Fuse.Reactive.ThreadWorker.Run () [0x00000] in <filename unknown>:0 <---

Thanks for the report! We’re investigating it right now.

Thanks for finding this one. A fix will be included in next build.

Cool :wink:

Confirm fixed in latest QA build