mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-03 21:07:07 +01:00
Support --assert option for validate command.
Cause HMR to return an error code if validation fails and the --assert option is present.
This commit is contained in:
@ -20,8 +20,7 @@ Error-handling routines for HackMyResume.
|
||||
|
||||
|
||||
/**
|
||||
An amorphous blob of error handling code for HackMyResume. Have an error?
|
||||
Stick it here. We don't mind.
|
||||
An amorphous blob of error handling code for HackMyResume.
|
||||
@class ErrorHandler
|
||||
*/
|
||||
var ErrorHandler = module.exports = {
|
||||
@ -37,8 +36,10 @@ Error-handling routines for HackMyResume.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( ex.fluenterror ){
|
||||
switch( ex.fluenterror ) { // TODO: Remove magic numbers
|
||||
|
||||
switch( ex.fluenterror ) {
|
||||
|
||||
case HACKMYSTATUS.themeNotFound:
|
||||
msg = "The specified theme couldn't be found: " + ex.data;
|
||||
@ -89,6 +90,9 @@ Error-handling routines for HackMyResume.
|
||||
'installed and accessible from your path.');
|
||||
break;
|
||||
|
||||
case HACKMYSTATUS.invalid:
|
||||
msg = chalk.red.bold('ERROR: Validation failed and the --assert option was specified.');
|
||||
break;
|
||||
}
|
||||
exitCode = ex.fluenterror;
|
||||
|
||||
|
@ -17,7 +17,8 @@ Status codes for HackMyResume.
|
||||
inputOutputParity: 7,
|
||||
createNameMissing: 8,
|
||||
wkhtmltopdf: 9,
|
||||
missingPackageJSON: 10
|
||||
missingPackageJSON: 10,
|
||||
invalid: 11
|
||||
};
|
||||
|
||||
}());
|
||||
|
Reference in New Issue
Block a user