mirror of
				https://github.com/JuanCanham/HackMyResume.git
				synced 2025-10-31 05:07:26 +00:00 
			
		
		
		
	Improve errors / tests consistency.
This commit is contained in:
		| @@ -40,13 +40,16 @@ Implementation of the 'analyze' verb for HackMyResume. | ||||
|   function analyze( sources, dst, opts ) { | ||||
|     this.stat('begin'); | ||||
|     if( !sources || !sources.length ) throw { fluenterror: 3 }; | ||||
|  | ||||
|     var nlzrs = _loadInspectors(); | ||||
|  | ||||
|     _.each(sources, function(src) { | ||||
|       var result = ResumeFactory.loadOne( src, { | ||||
|         format: 'FRESH', objectify: true, throw: false | ||||
|       }); | ||||
|       result.error || _analyze.call(this, result, nlzrs, opts ); | ||||
|         format: 'FRESH', objectify: true | ||||
|       }, this); | ||||
|       result.fluenterror || _analyze.call(this, result, nlzrs, opts ); | ||||
|     }, this); | ||||
|  | ||||
|     this.stat('end'); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -67,7 +67,7 @@ Implementation of the 'build' verb for HackMyResume. | ||||
|     // Load the theme...we do this first because the theme choice (FRESH or | ||||
|     // JSON Resume) determines what format we'll convert the resume to. | ||||
|     this.stat( HME.beforeTheme, { theme: _opts.theme }); | ||||
|     var tFolder = verifyTheme( _opts.theme ); | ||||
|     var tFolder = verifyTheme.call( this, _opts.theme ); | ||||
|     var theme = loadTheme( tFolder ); | ||||
|     this.stat( HME.afterTheme, { theme: theme }); | ||||
|  | ||||
|   | ||||
| @@ -57,8 +57,8 @@ Implementation of the 'validate' verb for HackMyResume. | ||||
|       var ret =  { file: src, isValid: false }; | ||||
|  | ||||
|       // If there was an error reading the resume | ||||
|       if( src.error ) { | ||||
|         if( opts.assert ) throw { fluenterror: HACKMYSTATUS.invalid }; | ||||
|       if( src.fluenterror ) { | ||||
|         if( opts.assert ) throw src; | ||||
|         return ret; | ||||
|       } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user