Await Axios response so we don't circumvent catch

Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406604110
This commit is contained in:
F. Eugene Aumson
2020-04-10 14:22:25 -04:00
parent 264407b707
commit 0cb5e4553b

View File

@@ -54,7 +54,7 @@ export class QuoteRequestor {
const responsesIfDefined: Array<void | AxiosResponse<SignedOrder>> = await Promise.all( const responsesIfDefined: Array<void | AxiosResponse<SignedOrder>> = await Promise.all(
this._rfqtMakerEndpoints.map(async rfqtMakerEndpoint => { this._rfqtMakerEndpoints.map(async rfqtMakerEndpoint => {
try { try {
return Axios.get<SignedOrder>(`${rfqtMakerEndpoint}/quote`, { return await Axios.get<SignedOrder>(`${rfqtMakerEndpoint}/quote`, {
headers: { '0x-api-key': takerApiKey }, headers: { '0x-api-key': takerApiKey },
params: { params: {
sellToken, sellToken,