개정판 a2a64028
ConvertService Webclient Dispose
Change-Id: I2da15bf6437478fb2724f83139ba2e130ced6da2
ConvertService/ServiceBase/Markus.Service.Convert/ConvertService.cs | ||
---|---|---|
283 | 283 |
{ |
284 | 284 |
result.Message = "ConvertService Convert Error" + ex.Message; |
285 | 285 |
result.StatusCode = StatusCodeType.Error; |
286 |
|
|
287 |
logger.Error(ex); |
|
286 | 288 |
} |
287 | 289 |
finally |
288 | 290 |
{ |
... | ... | |
355 | 357 |
using (System.Net.WebClient webClient = new System.Net.WebClient()) |
356 | 358 |
{ |
357 | 359 |
webClient.UseDefaultCredentials = true;//.Headers.Add("Authorization: BASIC SGVsbG8="); //가상의 인증 |
358 |
|
|
360 |
webClient.Proxy = null; |
|
359 | 361 |
//if (!System.IO.Directory.Exists(ConvertProcessContext.TempDirectory)) |
360 | 362 |
//{ |
361 | 363 |
// System.IO.Directory.CreateDirectory(ConvertProcessContext.TempDirectory); |
362 | 364 |
//} |
363 | 365 |
|
364 | 366 |
await webClient.DownloadFileTaskAsync(pdfFileUri, downloadFilePath); |
367 |
webClient.Dispose(); |
|
365 | 368 |
} |
366 | 369 |
} |
367 |
catch (Exception) |
|
370 |
catch (Exception ex)
|
|
368 | 371 |
{ |
372 |
logger.Error(ex); |
|
369 | 373 |
throw new Exception("File Download Error. Please, check the file path."); |
370 | 374 |
} |
371 | 375 |
} |
... | ... | |
393 | 397 |
|
394 | 398 |
} |
395 | 399 |
} |
396 |
catch (Exception) |
|
400 |
catch (Exception ex)
|
|
397 | 401 |
{ |
402 |
logger.Error(ex); |
|
398 | 403 |
throw new Exception("File Error ." + downloadFilePath); |
399 |
throw; |
|
400 | 404 |
} |
401 | 405 |
} |
402 | 406 |
catch (Exception ex) |
403 | 407 |
{ |
408 |
logger.Error(ex); |
|
404 | 409 |
throw new Exception(ex.ToString()); |
405 |
result = false; |
|
406 | 410 |
} |
407 | 411 |
|
408 | 412 |
return result; |
내보내기 Unified diff