1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added check to deletion to handle git accounts not existing.

This commit is contained in:
Uncled1023 2016-05-09 00:02:57 -07:00
parent 99378c6e30
commit 16099529d1

View File

@ -398,10 +398,14 @@ namespace Teknik.Areas.Profile.Controllers
return Json(new { error = "Unable to delete git account. Http Exception: " + htex.Message }); return Json(new { error = "Unable to delete git account. Http Exception: " + htex.Message });
} }
catch (Exception ex) catch (Exception ex)
{
// This error signifies the user doesn't exist, so we can continue deleting
if (ex.Message != "The remote server returned an error: (404) Not Found.")
{ {
return Json(new { error = "Unable to delete git account. Exception: " + ex.Message }); return Json(new { error = "Unable to delete git account. Exception: " + ex.Message });
} }
} }
}
// Update uploads // Update uploads
List<Upload.Models.Upload> uploads = db.Uploads.Include("User").Where(u => u.User.Username == User.Identity.Name).ToList(); List<Upload.Models.Upload> uploads = db.Uploads.Include("User").Where(u => u.User.Username == User.Identity.Name).ToList();