gajus / gajus/flow-runtime

Errors are sometimes thrown with "warn" option

Open
#113 3 comments 0 reactions 0 assignees View on GitHub
:dollar: Funded on Issuehunt bug
Dominant language
JavaScript
Stars
797
Forks
49
PR merge metrics
No merged PRs in 30d

Description

[Issuehunt badges](https://oss.issuehunt.io/r/gajus/flow-runtime/issues/113)

This is a:

- [x] Bug Report

Which concerns:

- [x] flow-runtime

---

### What is the current behaviour?

With the `warn: true` option, some invariants may still throw errors, for example this one: https://github.com/codemix/flow-runtime/blob/13e72fcc064bb6060c9ba49c58be3efe2f20ff40/packages/flow-runtime/src/flowTypes/%24ShapeType.js#L64

---

### What is the expected behaviour?

Runtime should log a warning.

---

### Which package versions are you using?

flow-runtime: 0.12

---

`warn` function (https://github.com/codemix/flow-runtime/blob/8bfdd7461f34d74bcb60247bf9b4b5644ab9e3b0/packages/flow-runtime/src/TypeContext.js#L1004) runs validation, but doesn't protect it from thrown errors

---

IssueHunt Summary

### Backers (Total: $20.00)

- [issuehunt issuehunt](https://oss.issuehunt.io/u/issuehunt) ($20.00)

### Submitted pull Requests
- [#299 fix: avoid throwing in warn mode when validation internals fail](https://oss.issuehunt.io/r/gajus/flow-runtime/pull/299)
---

#### [Become a backer now!](https://oss.issuehunt.io/r/gajus/flow-runtime/issues/113)
#### [Or submit a pull request to get the deposits!](https://oss.issuehunt.io/r/gajus/flow-runtime/issues/113)
### Tips

- Checkout the [Issuehunt explorer](https://oss.issuehunt.io/r/gajus/flow-runtime/) to discover more funded issues.
- Need some help from other developers? [Add your repositories](https://oss.issuehunt.io/r/new) on IssueHunt to raise funds.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.