Skip to content

Commit

Permalink
Use database path in exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bording committed Apr 3, 2024
1 parent 7ccb564 commit e5be540
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Expand Up @@ -23,9 +23,9 @@ public override Task<CheckResult> PerformCheck(CancellationToken cancellationTok
return CheckResult.Pass;
}

if (dataPathRoot == null)
if (dataPathRoot is null)
{
throw new Exception($"Unable to find the root of the data path {dataPathRoot}");
throw new Exception($"Unable to find the root of the data path {databaseConfiguration.ServerConfiguration.DbPath}");
}

var dataDriveInfo = new DriveInfo(dataPathRoot);
Expand Down
Expand Up @@ -15,8 +15,8 @@ public CheckMinimumStorageRequiredForIngestion(MinimumRequiredStorageState state
{
this.stateHolder = stateHolder;
this.databaseConfiguration = databaseConfiguration;
percentageThreshold = this.databaseConfiguration.MinimumStorageLeftRequiredForIngestion / 100m;
dataPathRoot = Path.GetPathRoot(databaseConfiguration.ServerConfiguration.DbPath);
percentageThreshold = this.databaseConfiguration.MinimumStorageLeftRequiredForIngestion / 100m;
}

public override Task<CheckResult> PerformCheck(CancellationToken cancellationToken = default)
Expand All @@ -32,9 +32,9 @@ public override Task<CheckResult> PerformCheck(CancellationToken cancellationTok
return CheckResult.Pass;
}

if (dataPathRoot == null)
if (dataPathRoot is null)
{
throw new Exception($"Unable to find the root of the data path {dataPathRoot}");
throw new Exception($"Unable to find the root of the data path {databaseConfiguration.ServerConfiguration.DbPath}");
}

var dataDriveInfo = new DriveInfo(dataPathRoot);
Expand Down
Expand Up @@ -22,9 +22,9 @@ public override Task<CheckResult> PerformCheck(CancellationToken cancellationTok
return CheckResult.Pass;
}

if (dataPathRoot == null)
if (dataPathRoot is null)
{
throw new Exception($"Unable to find the root of the data path {dataPathRoot}");
throw new Exception($"Unable to find the root of the data path {settings.DatabasePath}");
}

var dataDriveInfo = new DriveInfo(dataPathRoot);
Expand Down
Expand Up @@ -32,9 +32,9 @@ public override Task<CheckResult> PerformCheck(CancellationToken cancellationTok
return SuccessResult;
}

if (dataPathRoot == null)
if (dataPathRoot is null)
{
throw new Exception($"Unable to find the root of the data path {dataPathRoot}");
throw new Exception($"Unable to find the root of the data path {settings.DatabasePath}");
}

var dataDriveInfo = new DriveInfo(dataPathRoot);
Expand Down

0 comments on commit e5be540

Please sign in to comment.