Merge pull request #2665 from 0xProject/smaller_log
Smaller logs (avoid circular buffers) + add a boolean to indicate if order was included in the salad or not
This commit is contained in:
commit
15ce90c0ec
@ -86,8 +86,29 @@ function hasExpectedAssetData(
|
||||
}
|
||||
|
||||
function convertIfAxiosError(error: any): Error | object /* axios' .d.ts has AxiosError.toJSON() returning object */ {
|
||||
if (error.hasOwnProperty('isAxiosError') && error.isAxiosError && error.hasOwnProperty('toJSON')) {
|
||||
return error.toJSON();
|
||||
if (error.hasOwnProperty('isAxiosError') && error.isAxiosError) {
|
||||
const { message, name, config } = error;
|
||||
const { headers, timeout, httpsAgent } = config;
|
||||
const { keepAlive, keepAliveMsecs, sockets } = httpsAgent;
|
||||
|
||||
const socketCounts: { [key: string]: number } = {};
|
||||
for (const socket of Object.keys(sockets)) {
|
||||
socketCounts[socket] = sockets[socket].length;
|
||||
}
|
||||
|
||||
return {
|
||||
message,
|
||||
name,
|
||||
config: {
|
||||
headers,
|
||||
timeout,
|
||||
httpsAgent: {
|
||||
keepAlive,
|
||||
keepAliveMsecs,
|
||||
socketCounts,
|
||||
},
|
||||
},
|
||||
};
|
||||
} else {
|
||||
return error;
|
||||
}
|
||||
@ -351,6 +372,7 @@ export class QuoteRequestor {
|
||||
rfqtMakerInteraction: {
|
||||
...partialLogEntry,
|
||||
response: {
|
||||
included: true,
|
||||
statusCode: response.status,
|
||||
latencyMs: Date.now() - timeBeforeAwait,
|
||||
},
|
||||
@ -362,6 +384,7 @@ export class QuoteRequestor {
|
||||
rfqtMakerInteraction: {
|
||||
...partialLogEntry,
|
||||
response: {
|
||||
included: false,
|
||||
statusCode: err.response ? err.response.status : undefined,
|
||||
latencyMs: Date.now() - timeBeforeAwait,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user