Im working on a solution where i connect to a REST JSON api. If/when the Rest call fails i want to be able to display the error message to the user.
When i catch an Exception in my C# Web Service i throw the following to my clients:
catch (Exception e)
{
throw new WebFaultException(string.Format(e.Message), HttpStatusCode.BadRequest);
}
On my clients it is required to to catch as WebFaultException, but i cannot access System.ServiceModel.Web in my PCL code..
Am i supposed to use a Dependency Service to access this, since i can add System.ServiceModel.Web in both my Platform Specific Projects using "Add Reference"?
Anyone has a good guide or walkthrough i can take a look at?
Any help appreciated.
Cheers!