public async Task CancelAsync(string userId, Guid id) { try { await breaker.ExecuteAsync(() => innerProxy.CancelAsync(userId, id)); } catch (HttpOperationException ex) { throw new RemoteServiceFailedException(ex.StatusCode(), ex); } catch (BrokenCircuitException ex) { throw new RemoteServiceFailedException(ex.StatusCode(), ex); } }
public async Task <IActionResult> CancelConfirmed(Guid id, int facilityId) { try { await bookingService.CancelAsync(facilityId, id); return(RedirectToAction("Index")); } catch (BookingNotFoundException) { return(View("NotFound")); } catch (UserMismatchException) { return(BadRequest()); } }