asdasd
This commit is contained in:
parent
6d4b10ae4b
commit
e13e57a66b
2 changed files with 3 additions and 2 deletions
1
parse.js
1
parse.js
|
@ -8,6 +8,7 @@ const log = new Logger("server", cfg.log_level ? levels[cfg.log_level] : levels.
|
|||
export default function parse(data) {
|
||||
log.info(data)
|
||||
return {
|
||||
data: data,
|
||||
errors: ["not yet implemented"]
|
||||
}
|
||||
}
|
|
@ -27,10 +27,10 @@ export function recv(callback, errorCallback) {
|
|||
// con.write(functions_str);
|
||||
// log.debug(`sending ${functions_str}`);
|
||||
con.on('data', (data) => {
|
||||
let parsed_data = parse(data);
|
||||
let parsed_data = parse(String(data));
|
||||
|
||||
if (parsed_data.errors) {
|
||||
con.write(JSON.stringify(parsed_data.errors));
|
||||
con.write(JSON.stringify(parsed_data));
|
||||
errorCallback(parsed_data);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue