Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 1686 [details]
screenshot of the mentioned code
During testing I noticed app crashes because our call to a WCF experienced a timeout (GSM network issues during the time which made the data transfer slower then usual). We could not catch the timeout (which we set using the serviceClient.InnerChannel.OperationTimeout property) and this made the app crash.
Debugging showed that in the ClientRuntimeChannel.cs (in the dir <monotouch dir>/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/) on line 485 the code uses a "throws" statement in the catch part of a try..catch statement which makes it impossible to hook into this error.
We commented out this statement and were able to catch the error since then and at least represent the user with a neat alert.
Please remove the throw statement (which does not use the required expression parameter) so errors can be caught in custom code.
Any WCF exception is passed to the completed callback, in the EventArgs.Error property.
Here is an example of how to check for errors:
Then, perhaps the combination of seperate threads (async servicecall) and the service's channel with an execption make it so that my code doesn't receive a callback?
Normally we always retrieve a callback and in that i check for the error. I am using a client that was generated from the WCF service and check for errors like this:
void HandleServiceClientSendRequestCompleted (object sender, System.ComponentModel.AsyncCompletedEventArgs e)
if (e.Error == null)
Console.WriteLine("Dispatch success event ");
RequestSuccesvolVerzondenEvent(this, new EventArgs() );
ThrowServiceCallError(); // logs the error and sends a message so we can show an alert for the user
But if the callback never occurs (and the service isn't reached - we checked) there might be situations that aren't handled correctly.
I'll leave the status the same but i cannot get a callback with the usage of throw in the catch statement...
Can you add a test case I can try out?
I'll check if i can define one and will notify you when / if i succeed.