Skip to content

Commit

Permalink
Include more information for not resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Nov 5, 2018
1 parent 4ccb1c8 commit a4b4de8
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Documentation/Troubleshooting.md
Expand Up @@ -239,14 +239,31 @@ Add return types to your closures.


### My promise never resolves ### My promise never resolves


Check to be sure that your asynchronous task even *starts*. You’d be surprised how There are several potential causes:
often this is the cause.
#### 1. Check to be sure that your asynchronous task even *starts*

You’d be surprised how often this is the cause.


For example, if you are using `URLSession` without our extension (but For example, if you are using `URLSession` without our extension (but
don’t do that; *use* our extension! we know all the pitfalls), did you forget don’t do that; *use* our extension! we know all the pitfalls), did you forget
to call `resume` on the task? If so, the task never actually starts, and so of to call `resume` on the task? If so, the task never actually starts, and so of
course it never finishes, either. course it never finishes, either.


#### 2. Check that all paths in your custom Promise initializers are handled

See “Pending Promise Deallocated” above. Usually you will see this warning if
you are not handling a path, but that requires your promise deallocate, so you
may not see this warning yet you are still not handling all paths.

Unhandled paths mean the promise will not resolve.

#### 3. Ensure the queue your promise handler runs upon is not blocked

If the thread is blocked the handlers cannot execute. Commonly you can see this
if you are using our `wait()` function. Please read the documentation for `wait()`
for suggestions and caveats.

### `Result of call to 'done(on:_:)' is unused`, `Result of call to 'then(on:_:)' is unused` ### `Result of call to 'done(on:_:)' is unused`, `Result of call to 'then(on:_:)' is unused`


PromiseKit deliberately avoids the `@discardableResult` annotation because the PromiseKit deliberately avoids the `@discardableResult` annotation because the
Expand Down

0 comments on commit a4b4de8

Please sign in to comment.