Skip to content

Commit

Permalink
Update catch types to be any for TypeScript 4.4 (#1444)
Browse files Browse the repository at this point in the history
Due to https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables,
some TypeScript files failed to compile under TS 4.4 or later.
  • Loading branch information
alexeyr authored Jun 4, 2022
1 parent 3dfa1db commit fa2fe25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion node_package/src/buildConsoleReplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function consoleReplay(): string {
if (val === undefined) {
val = 'undefined';
}
} catch (e) {
} catch (e: any) {
val = `${e.message}: ${arg}`;
}

Expand Down
4 changes: 2 additions & 2 deletions node_package/src/clientStartup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ You should return a React.Component always for the client side entry point.`);
reactRender(domNode, reactElementOrRouterResult as ReactElement);
}
}
} catch (e) {
} catch (e: any) {
e.message = `ReactOnRails encountered an error while rendering component: ${name}.\n` +
`Original message: ${e.message}`;
throw e;
Expand Down Expand Up @@ -214,7 +214,7 @@ function unmount(el: Element): void {
if(domNode === null){return;}
try {
ReactDOM.unmountComponentAtNode(domNode);
} catch (e) {
} catch (e: any) {
console.info(`Caught error calling unmountComponentAtNode: ${e.message} for domNode`,
domNode, e);
}
Expand Down
4 changes: 2 additions & 2 deletions node_package/src/serverRenderReactComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ as a renderFunction and not a simple React Function Component.`);
} else {
renderResult = processReactElement();
}
} catch (e) {
} catch (e: any) {
if (throwJsErrors) {
throw e;
}
Expand Down Expand Up @@ -115,7 +115,7 @@ as a renderFunction and not a simple React Function Component.`);
consoleReplayScript,
hasErrors,
};
} catch (e) {
} catch (e: any) {
if (throwJsErrors) {
throw e;
}
Expand Down

0 comments on commit fa2fe25

Please sign in to comment.