Skip to content

Commit

Permalink
feat: Improved error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-meier committed Mar 1, 2023
1 parent 19742ae commit 78c694d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.Data;
using Microsoft.Data.Sqlite;

const string mbtilesFileName = "map_data.mbtiles";
var mbtilesPath = Environment.GetEnvironmentVariable("ASPNETCORE_MBTILES_PATH") ??
Path.Combine("data", "map_data.mbtiles");
Path.Combine("data", mbtilesFileName);

if (!File.Exists(mbtilesPath))
throw new FileNotFoundException(mbtilesPath);
throw new FileNotFoundException($"Required .mbtiles-file \"{mbtilesPath}\" not found.");

var builder = WebApplication.CreateBuilder(args);

Expand Down

0 comments on commit 78c694d

Please sign in to comment.