mirror of
https://github.com/zhigang1992/firebase-tools.git
synced 2026-05-25 01:11:37 +08:00
20 lines
413 B
JavaScript
20 lines
413 B
JavaScript
'use strict';
|
|
|
|
var logError = require('./logError');
|
|
var FirebaseError = require('./error');
|
|
|
|
module.exports = function(client, error) {
|
|
if (error.name !== 'FirebaseError') {
|
|
error = new FirebaseError('An unexpected error has occurred.', {
|
|
original: error,
|
|
exit: 2
|
|
});
|
|
}
|
|
|
|
logError(error);
|
|
process.exitCode = error.exit || 2;
|
|
setTimeout(function() {
|
|
process.exit();
|
|
}, 250);
|
|
};
|