Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        private HttpContext GetHttpContext()
        {
            var httpContext = Context.GetHttpContext();

            if (httpContext == null)
            {
                throw ConferenceError.UnexpectedError("An unexpected error occurred: HttpContext is null")
                      .ToException();
            }

            return(httpContext);
        }
Exemplo n.º 3
0
        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"));
        }