diff --git a/service/Abstractions/Pipeline/MimeTypeException.cs b/service/Abstractions/Pipeline/MimeTypeException.cs
new file mode 100644
index 000000000..3a305790d
--- /dev/null
+++ b/service/Abstractions/Pipeline/MimeTypeException.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft. All rights reserved.
+
+using System;
+
+namespace Microsoft.KernelMemory.Pipeline;
+
+public class MimeTypeException : KernelMemoryException
+{
+ ///
+ public MimeTypeException(bool? isTransient = null)
+ {
+ this.IsTransient = isTransient;
+ }
+
+ ///
+ public MimeTypeException(string message, bool? isTransient = null) : base(message)
+ {
+ this.IsTransient = isTransient;
+ }
+
+ ///
+ public MimeTypeException(string message, Exception? innerException, bool? isTransient = null) : base(message, innerException)
+ {
+ this.IsTransient = isTransient;
+ }
+}
diff --git a/service/Abstractions/Pipeline/MimeTypes.cs b/service/Abstractions/Pipeline/MimeTypes.cs
index 6efdc4aa8..956eeae39 100644
--- a/service/Abstractions/Pipeline/MimeTypes.cs
+++ b/service/Abstractions/Pipeline/MimeTypes.cs
@@ -221,7 +221,7 @@ public string GetFileType(string filename)
return mimeType;
}
- throw new NotSupportedException($"File type not supported: {filename}");
+ throw new MimeTypeException($"File type not supported: {filename}", isTransient: false);
}
public bool TryGetFileType(string filename, out string? mimeType)
diff --git a/service/Core/Pipeline/BaseOrchestrator.cs b/service/Core/Pipeline/BaseOrchestrator.cs
index 8311c0406..c613139b6 100644
--- a/service/Core/Pipeline/BaseOrchestrator.cs
+++ b/service/Core/Pipeline/BaseOrchestrator.cs
@@ -477,7 +477,7 @@ private async Task UploadFormFilesAsync(DataPipeline pipeline, CancellationToken
{
mimeType = this._mimeTypeDetection.GetFileType(file.FileName);
}
- catch (NotSupportedException)
+ catch (MimeTypeException)
{
this.Log.LogWarning("File type not supported, the ingestion pipeline might skip it");
}