mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
refactor(socket) getExec
This commit is contained in:
parent
c43a183333
commit
8f85326cf3
1 changed files with 4 additions and 7 deletions
|
|
@ -211,18 +211,15 @@
|
|||
function getExec(pSocket, pConnNum) {
|
||||
return function(pError, pStdout, pStderr) {
|
||||
var lErrorStr, lExecStr, lExec,
|
||||
lError = pStderr || pError;
|
||||
lError = pError || pStderr;
|
||||
|
||||
|
||||
if (lError)
|
||||
if ( Util.isString(lError) )
|
||||
lErrorStr = lError;
|
||||
else
|
||||
lErrorStr = Util.stringifyJSON( lError );
|
||||
if (!Util.isString(lError))
|
||||
lErrorStr = lError.toString() + '\n';
|
||||
|
||||
lExec = {
|
||||
stdout : pStdout,
|
||||
stderr : lError
|
||||
stderr : lErrorStr || lError
|
||||
};
|
||||
|
||||
lExecStr = JSON.stringify(lExec);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue