{"record":{"id":"c2fc6b12c9b0cb1e","repo":"Cysharp/UniTask","slug":"not-yet-completed","errorCode":null,"errorMessage":"Not yet completed.","messagePattern":"Not yet completed\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/Error.cs","lineNumber":50,"sourceCode":"            return new InvalidOperationException(\"Source sequence doesn't contain any elements.\");\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static Exception MoreThanOneElement()\n        {\n            return new InvalidOperationException(\"Source sequence contains more than one element.\");\n        }\n\n        [MethodImpl(MethodImplOptions.NoInlining)]\n        public static void ThrowArgumentException(string message)\n        {\n            throw new ArgumentException(message);\n        }\n\n        [MethodImpl(MethodImplOptions.NoInlining)]\n        public static void ThrowNotYetCompleted()\n        {\n            throw new InvalidOperationException(\"Not yet completed.\");\n        }\n\n        [MethodImpl(MethodImplOptions.NoInlining)]\n        public static T ThrowNotYetCompleted<T>()\n        {\n            throw new InvalidOperationException(\"Not yet completed.\");\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        public static void ThrowWhenContinuationIsAlreadyRegistered<T>(T continuationField)\n          where T : class\n        {\n            if (continuationField != null) ThrowInvalidOperationExceptionCore(\"continuation is already registered.\");\n        }\n\n        [MethodImpl(MethodImplOptions.NoInlining)]\n        static void ThrowInvalidOperationExceptionCore(string message)\n        {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/Cysharp/UniTask/blob/ceac8d6946b1125fe782cd171fbcb245b567dbf9/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/Error.cs#L32-L68","documentation":"Thrown by Error.ThrowNotYetCompleted() when GetResult() is called on a non-generic UniTask source that has not yet reached a completed state. UniTask is a value-type promise; its result can only be retrieved after the underlying source signals completion. Calling GetResult early is a contract violation.","triggerScenarios":"Manually invoking GetResult() on a UniTaskManualSource, UniTaskCompletionSource, or configured source before TrySetResult/TrySetCanceled/TrySetException has been called. Polling code that accesses GetResult without first checking Status.","commonSituations":"Low-level code that bypasses await and calls GetResult directly. A source that was created but never signaled due to a logic error. Test code that inspects a task before it completes.","solutions":["Always await the UniTask instead of calling GetResult manually — await handles the completion check internally.","If using a manual source, ensure TrySetResult is called before any GetResult access.","If you must poll, check source.Status == UniTaskStatus.Succeeded before calling GetResult."],"exampleFix":"// before\nvar source = new UniTaskCompletionSource();\nsource.GetResult(0); // throws: not yet completed\n\n// after\nvar source = new UniTaskCompletionSource();\nsource.TrySetResult();\nsource.GetResult(0); // ok","handlingStrategy":"validation","validationCode":"// Check status before calling GetResult\nif (source.GetStatus(shortVersion) == UniTaskStatus.Pending)\n{\n    // not ready yet; await instead\n    await source.Task;\n}\nsource.GetResult(shortVersion);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use await instead of manual GetResult calls.","If using UniTaskCompletionSource, ensure TrySetResult is called on all code paths before GetResult.","In test code, await the task fully before inspecting results."],"tags":["async","task-completion","misuse","getresult"],"backgroundTag":null,"analyzedSha":"ceac8d6946b1125fe782cd171fbcb245b567dbf9","analyzedAt":"2026-08-13T19:16:39.025Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}