Browse Source

Allow handling of `ToFileTimeUtc` error

disarray2077 3 years ago
parent
commit
4072e667c9
1 changed files with 2 additions and 4 deletions
  1. 2 4
      BeefLibs/corlib/src/DateTime.bf

+ 2 - 4
BeefLibs/corlib/src/DateTime.bf

@@ -555,15 +555,13 @@ namespace System
 			return ToUniversalTime().ToFileTimeUtc();
 		}
 
-		public int64 ToFileTimeUtc()
+		public Result<int64> ToFileTimeUtc()
 		{
 			// Treats the input as universal if it is not specified
 			int64 ticks = ((InternalKind & LocalMask) != 0UL) ? ToUniversalTime().InternalTicks : this.InternalTicks;
 			ticks -= FileTimeOffset;
 			if (ticks < 0)
-			{
-				Runtime.FatalError();
-			}
+				return .Err;
 			return ticks;
 		}