Skip to content

Commit 6b8b532

Browse files
authored
Thrown errors in client sagas are now logged to console. (#2087)
1 parent 49f2346 commit 6b8b532

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- [client] Fixed an issue where pressing enter opens the Azure government website instead of connecting to the bot [2073](https://github.com/microsoft/BotFramework-Emulator/pull/2073)
2323
- [build] Changed one-click installer to assisted installer with new graphics. Also updated application icon in PR [2077](https://github.com/microsoft/BotFramework-Emulator/pull/2077)
2424
- [build] Locked `[email protected]` to avoid unecessary import linting changes in PR [2081](https://github.com/microsoft/BotFramework-Emulator/pull/2081)
25+
- [client] Thrown errors in client-side sagas will now be logged in their entirety to the dev tools console in PR [2087](https://github.com/microsoft/BotFramework-Emulator/pull/2087)
2526

2627
## Removed
2728
- [client/main] Removed legacy payments code in PR [2058](https://github.com/microsoft/BotFramework-Emulator/pull/2058)

packages/app/client/src/state/utils/throwErrorFromResponse.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,18 @@ export function* throwErrorFromResponse(errorMessage: string, response: Response
5050
status,
5151
};
5252
if (text) {
53-
const errText = yield text();
53+
const errText = yield text.call(response);
5454
error.innerMessage = errText;
5555
}
5656
if (statusText) {
5757
error.description = `${response.status} ${response.statusText}`;
5858
} else {
5959
error.description = response.status + '';
6060
}
61+
/*
62+
* temporary way to surface saga errors until we update to redux-saga@^1.0.0 and can use top-level onError hook
63+
* (see https://github.com/redux-saga/redux-saga/issues/1308)
64+
*/
65+
console.error('Saga error: ', error); // eslint-disable-line
6166
throw error;
6267
}

0 commit comments

Comments
 (0)