Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Do not throw exception on Aura.Init, just warn
Browse files Browse the repository at this point in the history
  • Loading branch information
fsobolev committed Sep 6, 2023
1 parent fb3f411 commit 3492dbb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
2 changes: 0 additions & 2 deletions Nickvision.Aura.Tests/AuraTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ public class AuraTest
[Fact]
public void Init()
{
Assert.Throws<AuraException>(() => Aura.Active);
Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests");
Assert.Throws<AuraException>(() => Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests"));
Assert.IsType<Aura>(Aura.Active);
}
}
18 changes: 3 additions & 15 deletions Nickvision.Aura.Tests/UserDirectoriesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ public void Config()
[Fact]
public void ApplicationConfig()
{
try
{
Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests");
}
catch (AuraException) { }
Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests");
_output.WriteLine($"ApplicationConfig: {UserDirectories.ApplicationConfig}");
Assert.True(Directory.Exists(UserDirectories.ApplicationConfig));
}
Expand All @@ -50,11 +46,7 @@ public void Cache()
[Fact]
public void ApplicationCache()
{
try
{
Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests");
}
catch (AuraException) { }
Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests");
_output.WriteLine($"ApplicationCache: {UserDirectories.ApplicationCache}");
Assert.True(Directory.Exists(UserDirectories.ApplicationCache));
}
Expand All @@ -69,11 +61,7 @@ public void LocalData()
[Fact]
public void ApplicationLocalData()
{
try
{
Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests");
}
catch (AuraException) { }
Aura.Init("org.nickvision.Aura.Tests", "Nickvision Aura Tests");
_output.WriteLine($"ApplicationLocalData: {UserDirectories.ApplicationLocalData}");
Assert.True(Directory.Exists(UserDirectories.ApplicationLocalData));
}
Expand Down
3 changes: 2 additions & 1 deletion Nickvision.Aura/Aura.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public static void Init(string id, string name)
{
if (_instance != null)
{
throw new AuraException("Aura is already initialized.");
Console.WriteLine("[AURA] Warning: Aura was already initialized.");
return;
}
_instance = new Aura(id, name);
}
Expand Down

0 comments on commit 3492dbb

Please sign in to comment.