Toggle navigation
Toggle navigation
This project
Loading...
Sign in
윤창신
/
searchGuide
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김서영
2019-11-23 14:59:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6f1813ccf2aa06b35ffef709ac13ae9e28b76e5d
6f1813cc
1 parent
d374d787
api try catch - clienddata and analyzeData
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletions
api/cliConnection.js
api/cliConnection.js
View file @
6f1813c
...
...
@@ -10,11 +10,33 @@ const machineRead = require("./machineRead");
const
cliConnection
=
async
(
req
,
res
)
=>
{
let
clientData
=
{},
analyzeData
=
{},
searchData
=
[];
try
{
clientData
=
req
.
body
.
data
;
//clientData = req.body.data;
if
(
!
clientData
.
text
.
replace
(
/
\s
/g
,
''
).
length
)
{
throw
new
Error
(
"client text empty"
);
}
}
catch
(
err
)
{
console
.
log
(
err
);
res
.
json
(
{
"return_code"
:
-
1
,
"error_code"
:
err
.
message
}
);
res
.
status
(
403
);
return
false
;
}
analyzeData
=
await
textAnalytic
(
clientData
);
try
{
analyzeData
=
await
textAnalytic
(
clientData
);
}
catch
(
err
)
{
console
.
log
(
err
);
res
.
json
(
{
"return_code"
:
-
1
,
"error_code"
:
err
.
message
}
);
res
.
status
(
502
);
return
false
;
}
// searchData try catch
analyzeData
.
searchResults
=
searchData
;
res
.
send
({
return_code
:
0
,
return_data
:
analyzeData
});
...
...
Please
register
or
login
to post a comment