Skip to content

Commit

Permalink
Updated error documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronius authored Jan 25, 2019
1 parent f50fff0 commit 843476f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,17 @@ Penpal will throw (or reject promises with) errors in certain situations. Each e
* `connection.promise` will be rejected with this error after the `timeout` duration has elapsed and a connection has not been established.
* `Penpal.ERR_NOT_IN_IFRAME`
* This error will be thrown when attempting to call `Penpal.connectToParent()` from outside of an iframe context.
* `Penpal.ERR_IFRAME_ALREADY_ATTACHED_TO_DOM`
* This error will be thrown when an iframe already attached to the DOM is passed to `Penpal.connectToChild()`.

While these error codes are on the Penpal object itself, they are also named exports. You may import them as follows:

```
import {
ERR_CONNECTION_DESTROYED,
ERR_CONNECTION_TIMEOUT,
ERR_NOT_IN_IFRAME
ERR_NOT_IN_IFRAME,
ERR_IFRAME_ALREADY_ATTACHED_TO_DOM
} from 'penpal';
```

Expand Down

0 comments on commit 843476f

Please sign in to comment.