react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Failure to read script file should result in a more useful error

Open pre10der89 opened this issue 9 years ago • 4 comments

Passing a script filename that does not exist to RunScript will cause an AggregateException/InvalidOperationException/NullReferenceException, which will show a red box with the error "One or more errors occurred." when running the debug server and will otherwise go unhandled.

This is certainly an invalid operation, however, the issue being raised here is whether there is anything that could be done to make reporting this error more graceful/useful. The red box will show only the error "One or more errors occurred," which I believe is the AggregateException text. The inner exception, however, does contain a more useful message {"File read exception for asset ''."}

The cause for the invalid filename in our application is still not clear.

The following is the exception information from Windows Event Viewer when running a release bundle build:

Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException at PCLStorage.FileExtensions+d__0.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetResult() at ReactNative.Chakra.Executor.ChakraJavaScriptExecutor+d__16.MoveNext()

Exception Info: System.InvalidOperationException at ReactNative.Chakra.Executor.ChakraJavaScriptExecutor+d__16.MoveNext()

Exception Info: System.AggregateException at System.Threading.Tasks.Task1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetResultCore(Boolean) at ReactNative.Chakra.Executor.ChakraJavaScriptExecutor.RunScript(System.String, System.String) at ReactNative.Bridge.ReactBridge.RunScript(System.String, System.String) at ReactNative.Bridge.JavaScriptBundleLoader+FileJavaScriptBundleLoader.LoadScript(ReactNative.Bridge.IReactBridge) at ReactNative.Bridge.ReactInstance.<InitializeBridgeAsync>b__20_1() at ReactNative.Bridge.Queue.MessageQueueThreadExtensions+<>c__DisplayClass1_01[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].b__0() at ReactNative.Bridge.Queue.MessageQueueThread+SingleBackgroundMessageQueueThread.Run() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at ReactNative.DevSupport.DisabledDevSupportManager+<>c__DisplayClass18_0.b__0() at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore() at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult() at ReactNative.Bridge.DispatcherHelpers+d__7.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch()

pre10der89 avatar Aug 23 '17 22:08 pre10der89

@pre10der89 is this still an issue?

rozele avatar Jul 23 '18 21:07 rozele

@rozele This was a suggestion for improvement in error reporting. I can only assume it is still relevant, but have no qualms if it is closed

pre10der89 avatar Jul 24 '18 00:07 pre10der89

This is a valid issue with a repro case and active participant. I’d like to keep it open for people who browse/search open issues.

matthargett avatar Aug 09 '18 16:08 matthargett

We are not investing in new features or lower priority bug fixes on vCurrent. The bulk of investment is now in vNext as we prepare to make that the default choice. If this issue is still relevant on the vNext implementation please open a vNext issue. If this issue is of significant severity for a vCurrent app and vNext is not an option, re-open with justification.

ghost avatar Oct 25 '19 21:10 ghost