Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
chore: Run gts fix and manually fix some errors (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicKramer committed Dec 6, 2017
1 parent 1d300ac commit d7bec41
Show file tree
Hide file tree
Showing 37 changed files with 1,628 additions and 1,747 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/agent/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export interface StackdriverConfig extends common.AuthenticationConfig {
debug?: DebugAgentConfig;
}

const defaultConfig: DebugAgentConfig = {
export const defaultConfig: DebugAgentConfig = {
// FIXME(ofrobots): presently this is dependent what cwd() is at the time this
// file is first required. We should make the default config static.
workingDirectory: process.cwd(),
Expand Down Expand Up @@ -202,5 +202,3 @@ const defaultConfig: DebugAgentConfig = {
forceNewAgent_: false,
testMode_: false
};

export default defaultConfig;
16 changes: 9 additions & 7 deletions src/agent/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ export class Controller extends common.ServiceObject {
uri: API + '/debuggees/register',
method: 'POST',
json: true,
body: {debuggee: debuggee}
body: {debuggee}
};
this.request(
options,
function(err: Error, body: any, response: http.ServerResponse) {
(err: Error, body: {debuggee: Debuggee},
response: http.ServerResponse) => {
if (err) {
callback(err);
} else if (response.statusCode !== 200) {
Expand Down Expand Up @@ -98,8 +99,9 @@ export class Controller extends common.ServiceObject {
const uri = API + '/debuggees/' + encodeURIComponent(debuggee.id) +
'/breakpoints?' + qs.stringify(query);
that.request(
{uri: uri, json: true},
function(err: Error, body: any, response: http.ServerResponse) {
{uri, json: true},
(err: Error, body: stackdriver.ListBreakpointsResponse,
response: http.ServerResponse) => {
if (!response) {
callback(
err || new Error('unknown error - request response missing'));
Expand Down Expand Up @@ -130,7 +132,7 @@ export class Controller extends common.ServiceObject {
*/
updateBreakpoint(
debuggee: Debuggee, breakpoint: stackdriver.Breakpoint,
callback: (err?: Error, body?: any) => void): void {
callback: (err?: Error, body?: {}) => void): void {
assert(debuggee.id, 'should have a registered debuggee');

breakpoint.action = 'CAPTURE';
Expand All @@ -141,15 +143,15 @@ export class Controller extends common.ServiceObject {
'/breakpoints/' + encodeURIComponent(breakpoint.id as string),
json: true,
method: 'PUT',
body: {debuggeeId: debuggee.id, breakpoint: breakpoint}
body: {debuggeeId: debuggee.id, breakpoint}
};

// We need to have a try/catch here because a JSON.stringify will be done
// by request. Some V8 debug mirror objects get a throw when we attempt to
// stringify them. The try-catch keeps it resilient and avoids crashing the
// user's app.
try {
this.request(options, function(err: Error, body: any /*, response */) {
this.request(options, (err: Error, body: {} /*, response */) => {
callback(err, body);
});
} catch (error) {
Expand Down
Loading

0 comments on commit d7bec41

Please sign in to comment.