Skip to content

Commit 2bf48e5

Browse files
committed
Add the ProcessException class
1 parent 1d28371 commit 2bf48e5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/ITransformer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Belin.PhpMinifier;
33
/// <summary>
44
/// Removes comments and whitespace from a PHP script.
55
/// </summary>
6-
public interface ITransformer: IDisposable {
6+
public interface ITransformer: IAsyncDisposable {
77

88
/// <summary>
99
/// Processes a PHP script.

src/ProcessException.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Belin.PhpMinifier;
2+
3+
/// <summary>
4+
/// Exception thrown when an error has occurred during the execution of a process.
5+
/// </summary>
6+
/// <param name="fileName">The name of the document or application file that has been started.</param>
7+
/// <param name="message">The message that describes the error.</param>
8+
/// <param name="innerException">The exception that is the cause of the current exception.</param>
9+
public class ProcessException(string fileName, string message = "", Exception? innerException = null):
10+
Exception(message.Length > 0 ? message : $"The \"{fileName}\" process could not be started.", innerException) {
11+
12+
/// <summary>
13+
/// The name of the document or application file that has been started.
14+
/// </summary>
15+
public string FileName => fileName;
16+
}

0 commit comments

Comments
 (0)