public Task SampleMethod() { try { // code that can throw an exception } catch(Exception e) { // add code to log exception and take remedial steps return Clients.Caller.DisplayError("Sorry, the request could not be processed."); } }