From 9e08551ae5f421a3875fb1fe19bf243508d3dda0 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Thu, 15 Jul 2021 15:18:13 +0530 Subject: Added more logging while publishing of debug info. --- src/features/publishDebugInfo/Component.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/features') diff --git a/src/features/publishDebugInfo/Component.js b/src/features/publishDebugInfo/Component.js index e7949a0be..f97a7c750 100644 --- a/src/features/publishDebugInfo/Component.js +++ b/src/features/publishDebugInfo/Component.js @@ -13,6 +13,8 @@ import { DEBUG_API } from '../../config'; import AppStore from '../../stores/AppStore'; import ServicesStore from '../../stores/ServicesStore'; +const debug = require('debug')('Ferdi:feature:publishDebugInfo'); + const messages = defineMessages({ title: { id: 'feature.publishDebugInfo.title', @@ -100,6 +102,7 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class } async publishDebugInfo() { + debug('debugInfo: starting publish'); this.setState({ isSendingLog: true, }); @@ -112,17 +115,26 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class log: debugInfo, }), }, false); - const response = await request.json(); - if (response.id) { - this.setState({ - log: response.id, - }); + debug(`debugInfo: publishing status: ${request.status}`); + if (request.status === 200) { + const response = await request.json(); + if (response.id) { + this.setState({ + log: response.id, + }); + } else { + this.setState({ + error: true, + }); + } } else { this.setState({ error: true, }); } + + debug('debugInfo: finished publishing'); } render() { -- cgit v1.2.3-54-g00ecf