public static HttpContext GetHttpContext(this Hub hub) { var httpContext = hub.Context.GetHttpContext(); if (httpContext == null) { throw ConferenceError.UnexpectedError("An unexpected error occurred: HttpContext is null") .ToException(); } return(httpContext); }
private HttpContext GetHttpContext() { var httpContext = Context.GetHttpContext(); if (httpContext == null) { throw ConferenceError.UnexpectedError("An unexpected error occurred: HttpContext is null") .ToException(); } return(httpContext); }
public static Error ToError(this Exception e) { if (e is IdErrorException idError) { return(idError.Error); } if (e is ConferenceNotFoundException) { return(ConferenceError.ConferenceNotFound); } return(ConferenceError.UnexpectedError("An unexpected error occurred")); }