essai exeption null

pull/19/head
Liam MONCHANIN 2 years ago
parent 3245980afa
commit a2c7b26e11

@ -53,7 +53,7 @@ namespace Biblioteque_de_Class
{ {
if (logo.GetName() == name) { return logo.GetLogoLink(); } if (logo.GetName() == name) { return logo.GetLogoLink(); }
} }
throw new Exception("No logo link found."); throw new NullReferenceException("No logo link found.");
} }
/// <summary> /// <summary>
@ -68,7 +68,7 @@ namespace Biblioteque_de_Class
return user; return user;
} }
} }
throw new Exception("No user found with this username."); throw new NullReferenceException("No user found with this username.");
} }
/// <summary> /// <summary>
@ -124,7 +124,7 @@ namespace Biblioteque_de_Class
} }
else else
{ {
throw new Exception("User not found."); throw new NullReferenceException("User not found.");
} }
} }
@ -154,7 +154,7 @@ namespace Biblioteque_de_Class
} }
else else
{ {
throw new Exception("Theme not found."); throw new NullReferenceException("Theme not found.");
} }
} }
@ -170,7 +170,7 @@ namespace Biblioteque_de_Class
return theme; return theme;
} }
} }
throw new Exception("No theme found with this name."); throw new NullReferenceException("No theme found with this name.");
} }
/// <summary> /// <summary>
@ -186,7 +186,7 @@ namespace Biblioteque_de_Class
return; return;
} }
} }
throw new Exception("Theme not found."); throw new NullReferenceException("Theme not found.");
} }
/// <summary> /// <summary>
@ -205,7 +205,7 @@ namespace Biblioteque_de_Class
return; return;
} }
} }
throw new Exception("Theme not found."); throw new NullReferenceException("Theme not found.");
} }
} }
} }

@ -84,7 +84,7 @@ namespace Biblioteque_de_Class
} }
else else
{ {
throw new Exception("Image not found"); throw new NullReferenceException("Image not found");
} }
} }
} }
@ -100,7 +100,7 @@ namespace Biblioteque_de_Class
} }
else else
{ {
throw new Exception("User is not an editor"); throw new NullReferenceException("User is not an editor");
} }
} }
@ -110,7 +110,7 @@ namespace Biblioteque_de_Class
public void AddCollaborator(User owner, User user) public void AddCollaborator(User owner, User user)
{ {
if (VerifyOwner(owner)) { Collaborators.Add(user); } if (VerifyOwner(owner)) { Collaborators.Add(user); }
else { throw new Exception("User is not the owner"); } else { throw new NullReferenceException("User is not the owner"); }
} }
/// <summary> /// <summary>
@ -119,7 +119,7 @@ namespace Biblioteque_de_Class
public void RemoveCollaborator(User owner, User user) public void RemoveCollaborator(User owner, User user)
{ {
if (VerifyOwner(owner)) { Collaborators.Remove(user); } if (VerifyOwner(owner)) { Collaborators.Remove(user); }
else { throw new Exception("User is not the owner"); } else { throw new NullReferenceException("User is not the owner"); }
} }
/// <summary> /// <summary>
@ -128,7 +128,7 @@ namespace Biblioteque_de_Class
public void AddEditor(User owner, User user) public void AddEditor(User owner, User user)
{ {
if (VerifyOwner(owner)) { Editors.Add(user); } if (VerifyOwner(owner)) { Editors.Add(user); }
else { throw new Exception("User is not the owner"); } else { throw new NullReferenceException("User is not the owner"); }
} }
/// <summary> /// <summary>
@ -137,7 +137,7 @@ namespace Biblioteque_de_Class
public void RemoveEditor(User owner, User user) public void RemoveEditor(User owner, User user)
{ {
if (VerifyOwner(owner)) { Editors.Remove(user); } if (VerifyOwner(owner)) { Editors.Remove(user); }
else { throw new Exception("User is not the owner"); } else { throw new NullReferenceException("User is not the owner"); }
} }
} }
} }

@ -126,7 +126,7 @@ namespace Biblioteque_de_Class
} }
else else
{ {
throw new Exception("Note not found"); throw new NullReferenceException("Note not found");
} }
} }
@ -159,7 +159,7 @@ namespace Biblioteque_de_Class
} }
else else
{ {
throw new Exception("Note not found"); throw new NullReferenceException("Note not found");
} }
} }

Loading…
Cancel
Save