From 78c694d42f24c5b1fec378d72152691f27e90c59 Mon Sep 17 00:00:00 2001 From: Philipp Meier Date: Wed, 1 Mar 2023 21:30:19 +0100 Subject: [PATCH] feat: Improved error messages. --- src/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Program.cs b/src/Program.cs index 1a5cacc..4cd0c3f 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -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);