Skip to content

Commit

Permalink
fix(logreport): fixbug for logText assert
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyoukun committed Jul 12, 2018
1 parent b937512 commit 3eb9b54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/tsw/util/auto-report/logReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,24 +291,24 @@ module.exports.receiveCloud = function(req, res) {
return returnJson('get appkey error');
}

if (data.logText) {
return returnJson('logText is invalid');
if (!data.logText) {
return returnJson('logText is required');
}

if (typeof data.logText !== 'string') {
return returnJson('logText is not string');
return returnJson('logText is not a string');
}

if (data.logText.length >= 64 * 1024) {
return returnJson('logText is large than 64KB');
}

if (!data.logJson) {
return returnJson('logJson is invalid');
return returnJson('logJson is required');
}

if (typeof data.logJson !== 'string') {
return returnJson('logJson is not string');
return returnJson('logJson is not a string');
}

if (data.logText.length >= 1024 * 1024) {
Expand Down

0 comments on commit 3eb9b54

Please sign in to comment.