More exit handling fixes
Summary: Line 166 is missing a process.exit() causing the process to stay open forever if anything goes wrong. Making everything use errorAndExit, and making use of the utility function so we don't need to remember when to print e, and when to print e.message. Reviewed By: passy Differential Revision: D15989164 fbshipit-source-id: c683fa07d98fe49283a59b5f8108ef54babc97a3
This commit is contained in:
committed by
Facebook Github Bot
parent
1fd5fa23a1
commit
34f835ace8
@@ -290,11 +290,11 @@ export function exportStore(
|
||||
const {exportData, errorArray} = await getStoreExport(store);
|
||||
if (!exportData) {
|
||||
console.error('Make sure a device is connected');
|
||||
reject('No device is selected');
|
||||
reject(new Error('No device is selected'));
|
||||
}
|
||||
const serializedString = serialize(exportData);
|
||||
if (serializedString.length <= 0) {
|
||||
reject('Serialize function returned empty string');
|
||||
reject(new Error('Serialize function returned empty string'));
|
||||
}
|
||||
resolve({serializedString, errorArray});
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user