mirror of
				https://github.com/JuanCanham/HackMyResume.git
				synced 2025-10-31 05:07:26 +00:00 
			
		
		
		
	Better support for spawn errors encountered during generation (for ex, PDFs through wkhtml) + general refactoring.
		
			
				
	
	
		
			23 lines
		
	
	
		
			506 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			506 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /**
 | |
| @module spawn-watch.js
 | |
| */
 | |
| 
 | |
| (function() {
 | |
| 
 | |
| // Catch various out-of-band child process errors such as ENOENT for PDFs
 | |
| // http://stackoverflow.com/q/27688804
 | |
| var SpawnWatcher = module.exports = function() {
 | |
|   var childProcess = require("child_process");
 | |
|   var oldSpawn = childProcess.spawn;
 | |
|   childProcess.spawn = function() {
 | |
|     return oldSpawn.apply(this, arguments)
 | |
|       .on('error', function(err) {
 | |
|         require('./error-handler').err( err, false );
 | |
|       });
 | |
|   };
 | |
| }();
 | |
| 
 | |
| //SpawnWatcher();
 | |
| 
 | |
| }());
 |