Skip to content

Commit 3ff15f7

Browse files
authored
Refactor Print methods to return bool and add Fail method
1 parent e972d78 commit 3ff15f7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

HashifyNETCLI/Core/ScriptHelpers.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// *
1+
// *
22
// *****************************************************************************
33
// *
44
// * Copyright (c) 2025 Deskasoft International
@@ -33,14 +33,21 @@ namespace HashifyNETCLI
3333
{
3434
public static class ScriptHelpers
3535
{
36-
public static void Print(string message, params object[] args)
36+
public static bool Print(string message, params object[] args)
3737
{
3838
Logger.Script(message, args);
39+
return true;
3940
}
4041

41-
public static void Print(object message, params object[] args)
42+
public static bool Print(object message, params object[] args)
4243
{
4344
Logger.Script(message is string ? (string)message : message?.ToString() ?? "N/A", args);
45+
return true;
46+
}
47+
48+
public static bool Fail(string message, params object[] args)
49+
{
50+
throw new FailException(string.Format(message, args));
4451
}
4552

4653
public static byte[] StringToArray(string input)

0 commit comments

Comments
 (0)