From d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Tue, 6 Mar 2018 15:34:32 -0800 Subject: Print error message when no orders are found from /orders --- packages/sra-report/src/postman_environment_factory.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/sra-report') diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts index 91fbb5d2c..066e9ac04 100644 --- a/packages/sra-report/src/postman_environment_factory.ts +++ b/packages/sra-report/src/postman_environment_factory.ts @@ -1,10 +1,12 @@ import { SignedOrder, ZeroEx } from '0x.js'; import { HttpClient } from '@0xproject/connect'; import { Schema, schemas as schemasByName } from '@0xproject/json-schemas'; +import chalk from 'chalk'; import * as _ from 'lodash'; import { addresses as kovanAddresses } from './contract_addresses/kovan_addresses'; import { addresses as mainnetAddresses } from './contract_addresses/mainnet_addresses'; +import { utils } from './utils'; interface EnvironmentValue { key: string; @@ -61,7 +63,6 @@ function createContractAddressEnvironmentValues(networkId: number) { createEnvironmentValue('exchangeContractAddress', contractAddresses.EXCHANGE), ]; } - async function createOrderEnvironmentValuesAsync(url: string) { const httpClient = new HttpClient(url); const orders = await httpClient.getOrdersAsync(); @@ -75,6 +76,7 @@ async function createOrderEnvironmentValuesAsync(url: string) { createEnvironmentValue('orderHash', ZeroEx.getOrderHashHex(orderIfExists)), ]; } else { + utils.log(`${chalk.red(`No orders from /orders found`)}`); return [ createEnvironmentValue('order', ''), createEnvironmentValue('orderMaker', ''), -- cgit v1.2.3