/// <summary> /// Processes the response. /// </summary> /// <param name="url">The URL.</param> /// <param name="ex">The ex.</param> public Exception ProcessException(string url, Exception ex) { var innerEx = GetInnerException(ex); ApiLogger.Error(innerEx, $"{url}"); return(innerEx); }
public void ShouldPostRequest() { //Arrange var logger = new ApiLogger("http://postb.in/b/Tgix0BIX", null, LogLevel.Trace); //Act logger.Error("Checking error"); //Assert Assert.True(true); }
public async Task <IActionResult> GetAll() { ApiLogger.Info("Getting all customers!"); using (var customerService = new CustomerService(ApiLogger, new UnitOfWork(ApiLogger, SalesContext), Mapper)) { try { await Task.Delay(1000); var customers = await customerService.LoadAllCustomersAsync(); return(Ok(customers)); } catch (Exception ex) { ApiLogger.Error("Error while getting all customers!", ex: ex); return(StatusCode(500)); } } }
public async Task <IActionResult> GetAll() { ApiLogger.Info("Getting all available apps!"); using (var appService = new AppService(ApiLogger, new UnitOfWork(ApiLogger, SalesContext), Mapper)) { try { await Task.Delay(2000); var apps = await appService.LoadAllAppsAsync(); return(Ok(apps)); } catch (Exception ex) { ApiLogger.Error("Error while getting all apps!", ex: ex); return(StatusCode(500)); } } }