Skip to content

Commit

Permalink
Cast our unknown error to an Error
Browse files Browse the repository at this point in the history
useAsync generally does not know how what its tasks are going to be
rejected with, hence the unknown.

For these API calls we know that it will be an Error, but I don't
currently have a way to type that generally. For now, we'll cast it
where we use it.
  • Loading branch information
rylnd committed Jul 14, 2020
1 parent bc984c4 commit 66d8241
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const ValueListsFormComponent: React.FC<ValueListsFormProps> = ({ onError
if (!importState.loading && importState.result) {
handleSuccess(importState.result);
} else if (!importState.loading && importState.error) {
handleError(importState.error);
handleError(importState.error as Error);
}
}, [handleError, handleSuccess, importState.error, importState.loading, importState.result]);

Expand Down

0 comments on commit 66d8241

Please sign in to comment.