Skip to content

Commit

Permalink
Thrown errors in client sagas are now logged to console.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyanziano committed Feb 27, 2020
1 parent 49f2346 commit 3126dd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [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)
- [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)
- [build] Locked `eslint-plugin-import@2.20.0` to avoid unecessary import linting changes in PR [2081](https://github.com/microsoft/BotFramework-Emulator/pull/2081)
- [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)

## Removed
- [client/main] Removed legacy payments code in PR [2058](https://github.com/microsoft/BotFramework-Emulator/pull/2058)
Expand Down
Expand Up @@ -50,13 +50,18 @@ export function* throwErrorFromResponse(errorMessage: string, response: Response
status,
};
if (text) {
const errText = yield text();
const errText = yield text.call(response);
error.innerMessage = errText;
}
if (statusText) {
error.description = `${response.status} ${response.statusText}`;
} else {
error.description = response.status + '';
}
/*
* temporary way to surface saga errors until we update to redux-saga@^1.0.0 and can use top-level onError hook
* (see https://github.com/redux-saga/redux-saga/issues/1308)
*/
console.error('Saga error: ', error); // eslint-disable-line
throw error;
}

0 comments on commit 3126dd1

Please sign in to comment.