Move FLIPPER_PORTS error handling out of function
Summary:
The function itself can easily be pure. Let's have the side-effects
(lookup of env variable and error handling) outside of it. Also
prevents spam in the test log (which I intend to make a test failure
going forwards).
Current output:
{F149794656}
Reviewed By: jknoxville
Differential Revision: D13894995
fbshipit-source-id: dacf51f8b35cb427740f9566ef993ffc6b2c3906
This commit is contained in:
committed by
Facebook Github Bot
parent
14b1583eb0
commit
1101306249
@@ -70,6 +70,12 @@ export default (store: Store, logger: Logger) => {
|
|||||||
type: 'SET_SERVER_PORTS',
|
type: 'SET_SERVER_PORTS',
|
||||||
payload: portOverrides,
|
payload: portOverrides,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
console.error(
|
||||||
|
`Ignoring malformed FLIPPER_PORTS env variable:
|
||||||
|
"${process.env.FLIPPER_PORTS || ''}".
|
||||||
|
Example expected format: "1111,2222".`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,9 +21,5 @@ export function parseFlipperPorts(
|
|||||||
insecure: ports[0],
|
insecure: ports[0],
|
||||||
secure: ports[1],
|
secure: ports[1],
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
console.error(
|
|
||||||
`Ignoring malformed FLIPPER_PORTS env variable: "${envVar}". Example expected format: "1111,2222".`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user