Skip to content

Commit b0fa4c4

Browse files
committed
Fix the 'Unexpected end of input' error message.
1 parent 6da6891 commit b0fa4c4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

nativescript/android/androidDebugConnection.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class ResReqNetSocket extends EventEmitter {
106106
that.conn.on('close', function() {
107107
if (!that.connected)
108108
{
109-
reject("Cannot not connect. Check the application is running on the device");
109+
reject("Can't connect. Check the application is running on the device");
110110
that.emit('close', that.lastError || 'Debugged process exited.');
111111
return;
112112
}
@@ -136,16 +136,14 @@ class ResReqNetSocket extends EventEmitter {
136136
this.debugBuffer = b.toString('utf8', this.msg.contentLength, b.length);
137137
if (this.msg.body.length > 0) {
138138
obj = JSON.parse(this.msg.body);
139+
Logger.log('From target(' + (obj.type ? obj.type : '') + '): ' + this.msg.body);
139140
if (typeof obj.running === 'boolean') {
140141
this.isRunning = obj.running;
141142
}
142143
if (obj.type === 'response' && obj.request_seq > 0) {
143-
console.log('response: ' + this.msg.body);
144144
this.callbacks.processResponse(obj.request_seq, [obj]);
145145
}
146146
else if (obj.type === 'event') {
147-
console.log('event: ' + obj.event + " obj: " + JSON.stringify(obj));
148-
149147
if (obj.event === "afterCompile") {
150148
if (!that.connected && connectedCallback) {
151149
connectedCallback();
@@ -154,9 +152,6 @@ class ResReqNetSocket extends EventEmitter {
154152

155153
this.emit(obj.event, obj);
156154
}
157-
else {
158-
console.log('unknown: ' + this.msg.body);
159-
}
160155
}
161156
this.msg = false;
162157
this.parse(connectedCallback);
@@ -186,6 +181,7 @@ class ResReqNetSocket extends EventEmitter {
186181

187182
public send(data) {
188183
if (this.connected) {
184+
Logger.log('To target: ' + data);
189185
this.conn.write('Content-Length: ' + data.length + '\r\n\r\n' + data);
190186
}
191187
}

0 commit comments

Comments
 (0)