MCPcopy Create free account
hub / github.com/Marus/cortex-debug / onStderr

Method onStderr

src/backend/server.ts:166–185  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

164 }
165
166 private onStderr(data) {
167 this.sendToConsole(data); // Send it without any processing or buffering
168 if (this.initResolve) {
169 if (typeof data === 'string') { this.errBuffer += data; }
170 else { this.errBuffer += data.toString('utf8'); }
171
172 if (this.initResolve && this.initMatch && this.initMatch.test(this.errBuffer)) {
173 // console.log(`********* Got initmatch on stderr ${Date.now() - this.startTime}ms`);
174 this.initResolve(true);
175 this.initResolve = null;
176 this.initReject = null;
177 }
178
179 const end = this.errBuffer.lastIndexOf('\n');
180 if (end !== -1) {
181 // this.emit('output', this.errBuffer.substring(0, end));
182 this.errBuffer = this.errBuffer.substring(end + 1);
183 }
184 }
185 }
186
187 protected connectToConsole(): Promise<void> {
188 return new Promise<void>((resolve, reject) => {

Callers

nothing calls this directly

Calls 2

sendToConsoleMethod · 0.95
toStringMethod · 0.80

Tested by

no test coverage detected