Skip to content

Commit 491d79b

Browse files
committed
fix: set type for caught exception e
1 parent ad89550 commit 491d79b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

course-04/project/c4-final-project-starter-code/client/src/components/EditTodo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class EditTodo extends React.PureComponent<
5858

5959
alert('File was uploaded!')
6060
} catch (e) {
61-
alert('Could not upload a file: ' + e.message)
61+
alert('Could not upload a file: ' + (e as Error).message)
6262
} finally {
6363
this.setUploadState(UploadState.NoUpload)
6464
}

course-04/project/c4-final-project-starter-code/client/src/components/Todos.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class Todos extends React.PureComponent<TodosProps, TodosState> {
9797
loadingTodos: false
9898
})
9999
} catch (e) {
100-
alert(`Failed to fetch todos: ${e.message}`)
100+
alert(`Failed to fetch todos: ${(e as Error).message}`)
101101
}
102102
}
103103

0 commit comments

Comments
 (0)