-
Notifications
You must be signed in to change notification settings - Fork 896
Upgrade Typescript to 4.5.3 to match Kibana #5591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
be0ee89
02026e6
bcb4420
22b4d47
b836660
345db9c
a607fdf
d12815c
e217741
1d29ce0
58826b6
8a6352e
3779869
3684d2c
a1f209e
1a6aa52
dede73b
97a5cd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,7 +169,10 @@ export class EuiSearchBar extends Component<EuiSearchBarProps, State> { | |
| this.notifyControllingParent({ query, queryText, error: null }); | ||
| this.setState({ query, queryText, error: null }); | ||
| } catch (e) { | ||
| const error: Error = { name: e.name, message: e.message }; | ||
| const error: Error = | ||
| e instanceof Error | ||
| ? { name: e.name, message: e.message } | ||
| : { name: 'Unexpected error', message: String(e) }; | ||
|
Comment on lines
+172
to
+175
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Obligatory https://stackoverflow.com/a/68257472/4294462: In TS 4.4+ caught errors default to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe check for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm, I'd be more tempted to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably too engineery at that point, and leaving as-is makes more sense? 🙂
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough! We can keep it in our back pockets for later if we add more try/catches |
||
| this.notifyControllingParent({ query: null, queryText, error }); | ||
| this.setState({ queryText, error }); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.