Skip to content

Commit

Permalink
Requested changes: reverts some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkaseman committed Jan 14, 2021
1 parent 0cf74c8 commit 0eb9cc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions bootstrap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
AdapterRequest,
ExecuteWrappedResponse,
AdapterHealthCheck,
AdapterErrorResponse,
} from '@chainlink/types'

type Middleware = (execute: ExecuteWrappedResponse) => Promise<ExecuteWrappedResponse>
Expand Down Expand Up @@ -43,10 +42,10 @@ const withStatusCode = (execute: ExecuteWrappedResponse) => async (data_: Adapte

// Log adapter input & output data
const withLogger = (execute: ExecuteWrappedResponse) => async (data: AdapterRequest) => {
logger.debug({ input: data })
logger.debug('Input: ', { input: data })
try {
const result = await execute(data)
logger.debug({ output: result.data })
logger.debug(`Output: [${result.statusCode}]: `, { output: result.data })
return result
} catch (error) {
logger.error(error.toString(), { stack: error.stack })
Expand Down
9 changes: 5 additions & 4 deletions external-adapter/src/requester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ export class Requester {
}

// Success
const { request: r, ...rest } = response
const { data, status, statusText } = response
logger.debug({
message: 'Received response',
...rest,
data,
status,
statusText,
})
return response
}
Expand Down Expand Up @@ -98,8 +100,7 @@ export class Requester {
jobRunID,
statusCode,
message: error.message,
name: error.name,
cause: error.stack,
cause: error,
}).toJSONResponse()
}
return new AdapterError({ jobRunID, statusCode, message: error }).toJSONResponse()
Expand Down

0 comments on commit 0eb9cc9

Please sign in to comment.