Skip to content

Commit e0b8bcc

Browse files
committed
Adding error message to the 404 NotFound response.
1 parent d517d73 commit e0b8bcc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

eFormAPI/eFormAPI/Controllers/TemplateFilesController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ public HttpResponseMessage GetImage(string fileName, string ext, string noCache
5050
var filePath = HttpContext.Current.Server.MapPath($"~/output/datafolder/picture/{fileName}.{ext}");
5151
if (!File.Exists(filePath))
5252
{
53-
return new HttpResponseMessage(HttpStatusCode.NotFound);
53+
var resultNotFound = new HttpResponseMessage(HttpStatusCode.NotFound);
54+
resultNotFound.Content = new StringContent($"Trying to find file at location: {filePath}");
55+
return resultNotFound;
5456
}
5557
var extention = Path.GetExtension(filePath).Replace(".", "");
5658

0 commit comments

Comments
 (0)