소스 검색

Merge pull request #1469 from disarray2077/patch-2

Allow handling of `ToFileTimeUtc` error
Brian Fiete 3 년 전
부모
커밋
16d9160bd2
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      BeefLibs/corlib/src/DateTime.bf

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

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