mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Added error handling to paste/upload deletions
This commit is contained in:
parent
8954102306
commit
22f2a1ae00
@ -427,7 +427,14 @@ namespace Teknik.Areas.Paste.Controllers
|
||||
// Delete the File
|
||||
if (System.IO.File.Exists(delPath))
|
||||
{
|
||||
System.IO.File.Delete(delPath);
|
||||
try
|
||||
{
|
||||
System.IO.File.Delete(delPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Unable to delete file: {0}", paste.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -561,7 +561,14 @@ namespace Teknik.Areas.Upload.Controllers
|
||||
// Delete the File
|
||||
if (System.IO.File.Exists(filePath))
|
||||
{
|
||||
System.IO.File.Delete(filePath);
|
||||
try
|
||||
{
|
||||
System.IO.File.Delete(filePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Unable to delete file: {0}", upload.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete from the DB
|
||||
|
Loading…
Reference in New Issue
Block a user